@sikka/hawa 0.29.14-next → 0.30.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/blocks/feedback/index.js +15 -13
- package/dist/blocks/feedback/index.mjs +15 -13
- package/dist/blocks/index.js +15 -13
- package/dist/blocks/index.mjs +1 -1
- package/dist/{chunk-XKVSLAKW.mjs → chunk-TGB72TYK.mjs} +15 -13
- package/dist/combobox/index.d.mts +1 -0
- package/dist/combobox/index.d.ts +1 -0
- package/dist/combobox/index.js +224 -218
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +224 -218
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.js +1 -1
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/command/index.mjs.map +1 -1
- package/dist/dataTable/index.d.mts +1 -1
- package/dist/dataTable/index.d.ts +1 -1
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/dialog/index.d.mts +1 -0
- package/dist/dialog/index.d.ts +1 -0
- 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 +9 -4
- package/dist/elements/index.d.ts +9 -4
- package/dist/elements/index.js +87 -81
- package/dist/elements/index.mjs +15 -11
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +87 -81
- package/dist/index.mjs +113 -107
- package/dist/passwordInput/index.js +15 -13
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +15 -13
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/popover/index.d.mts +3 -1
- package/dist/popover/index.d.ts +3 -1
- package/dist/popover/index.js +15 -13
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/index.mjs +15 -13
- package/dist/popover/index.mjs.map +1 -1
- package/dist/simpleTable/index.d.mts +4 -3
- package/dist/simpleTable/index.d.ts +4 -3
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/elements/index.mjs
CHANGED
@@ -28,7 +28,7 @@ import {
|
|
28
28
|
TabsTrigger,
|
29
29
|
Textarea,
|
30
30
|
UncheckMark
|
31
|
-
} from "../chunk-
|
31
|
+
} from "../chunk-TGB72TYK.mjs";
|
32
32
|
import {
|
33
33
|
Sheet,
|
34
34
|
SheetClose,
|
@@ -385,7 +385,7 @@ var DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
385
385
|
...props
|
386
386
|
}
|
387
387
|
));
|
388
|
-
var DialogContent = React6.forwardRef(({ className, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React6.createElement(DialogPortal,
|
388
|
+
var DialogContent = React6.forwardRef(({ className, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React6.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React6.createElement(DialogOverlay, null), /* @__PURE__ */ React6.createElement(
|
389
389
|
DialogPrimitive.Content,
|
390
390
|
{
|
391
391
|
onPointerDownOutside: (e) => {
|
@@ -1465,11 +1465,13 @@ var Combobox = React13.forwardRef(
|
|
1465
1465
|
direction,
|
1466
1466
|
labelProps,
|
1467
1467
|
data,
|
1468
|
+
renderOption,
|
1468
1469
|
...props
|
1469
1470
|
}, ref) => {
|
1470
1471
|
var _a, _b, _c;
|
1471
1472
|
const [open, setOpen] = React13.useState(false);
|
1472
1473
|
const [value, setValue] = React13.useState(defaultValue);
|
1474
|
+
const containerRef = React13.useRef(null);
|
1473
1475
|
function getProperty(obj, key) {
|
1474
1476
|
return obj[key];
|
1475
1477
|
}
|
@@ -1484,7 +1486,8 @@ var Combobox = React13.forwardRef(
|
|
1484
1486
|
className: cn(
|
1485
1487
|
"hawa-relative hawa-flex hawa-h-fit hawa-flex-col hawa-gap-2",
|
1486
1488
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
1487
|
-
)
|
1489
|
+
),
|
1490
|
+
ref: containerRef
|
1488
1491
|
},
|
1489
1492
|
props.label && /* @__PURE__ */ React13.createElement(Label, { ...labelProps }, props.label),
|
1490
1493
|
/* @__PURE__ */ React13.createElement(PopoverPrimitive.Root, { open, onOpenChange: handleOpenChange }, /* @__PURE__ */ React13.createElement(PopoverTrigger, { asChild: true }, props.isLoading ? /* @__PURE__ */ React13.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React13.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React13.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-start hawa-gap-2 " }, /* @__PURE__ */ React13.createElement(
|
@@ -1542,7 +1545,8 @@ var Combobox = React13.forwardRef(
|
|
1542
1545
|
{
|
1543
1546
|
sideOffset: 0,
|
1544
1547
|
className: cn("popover-w-parent", props.helperText && "-hawa-mt-4"),
|
1545
|
-
dir: direction
|
1548
|
+
dir: direction,
|
1549
|
+
container: containerRef.current
|
1546
1550
|
},
|
1547
1551
|
/* @__PURE__ */ React13.createElement(Command, null, !props.hideInput && /* @__PURE__ */ React13.createElement(
|
1548
1552
|
CommandInput,
|
@@ -1550,7 +1554,7 @@ var Combobox = React13.forwardRef(
|
|
1550
1554
|
dir: direction,
|
1551
1555
|
placeholder: ((_b = props.texts) == null ? void 0 : _b.searchPlaceholder) || "Search"
|
1552
1556
|
}
|
1553
|
-
), /* @__PURE__ */ React13.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."), /* @__PURE__ */ React13.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-
|
1557
|
+
), /* @__PURE__ */ React13.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."), /* @__PURE__ */ React13.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-scroll" }, data.map((item, i) => /* @__PURE__ */ React13.createElement(
|
1554
1558
|
CommandItem,
|
1555
1559
|
{
|
1556
1560
|
key: i,
|
@@ -1586,7 +1590,7 @@ var Combobox = React13.forwardRef(
|
|
1586
1590
|
},
|
1587
1591
|
/* @__PURE__ */ React13.createElement("polyline", { points: "20 6 9 17 4 12" })
|
1588
1592
|
),
|
1589
|
-
getProperty(item, labelKey)
|
1593
|
+
renderOption ? renderOption(item) : getProperty(item, labelKey)
|
1590
1594
|
))))
|
1591
1595
|
))
|
1592
1596
|
);
|
@@ -1987,7 +1991,7 @@ var AppStores = (props) => {
|
|
1987
1991
|
};
|
1988
1992
|
|
1989
1993
|
// elements/badge/Badge.tsx
|
1990
|
-
import React19, { useEffect as useEffect5, useState as useState7, useRef as
|
1994
|
+
import React19, { useEffect as useEffect5, useState as useState7, useRef as useRef5 } from "react";
|
1991
1995
|
var Badge = ({
|
1992
1996
|
anchor,
|
1993
1997
|
position = "right",
|
@@ -1996,7 +2000,7 @@ var Badge = ({
|
|
1996
2000
|
className
|
1997
2001
|
}) => {
|
1998
2002
|
const [badgePosition, setBadgePosition] = useState7(null);
|
1999
|
-
const indicatorRef =
|
2003
|
+
const indicatorRef = useRef5(null);
|
2000
2004
|
const sizeStyles2 = {
|
2001
2005
|
small: { top: 4, left: 6, right: 7, classes: "hawa-w-3 hawa-h-3" },
|
2002
2006
|
default: { top: 4, left: 7, right: 5, classes: "hawa-w-3 hawa-h-3" },
|
@@ -2050,7 +2054,7 @@ var BadgedComponent = ({
|
|
2050
2054
|
size,
|
2051
2055
|
text
|
2052
2056
|
}) => {
|
2053
|
-
const ref =
|
2057
|
+
const ref = useRef5(null);
|
2054
2058
|
return /* @__PURE__ */ React19.createElement("div", { className: cn("hawa-relative hawa-w-fit", className), ref }, !hideBadge && /* @__PURE__ */ React19.createElement(
|
2055
2059
|
Badge,
|
2056
2060
|
{
|
@@ -3132,7 +3136,7 @@ function Toaster(props) {
|
|
3132
3136
|
}
|
3133
3137
|
|
3134
3138
|
// elements/destroyableCard/DestroyableCard.tsx
|
3135
|
-
import React32, { useRef as
|
3139
|
+
import React32, { useRef as useRef6, useState as useState13 } from "react";
|
3136
3140
|
var DestroyableCard = ({
|
3137
3141
|
position = "bottom-right",
|
3138
3142
|
fixed,
|
@@ -3140,7 +3144,7 @@ var DestroyableCard = ({
|
|
3140
3144
|
...props
|
3141
3145
|
}) => {
|
3142
3146
|
const [closed, setClosed] = useState13(false);
|
3143
|
-
const popUpRef =
|
3147
|
+
const popUpRef = useRef6(null);
|
3144
3148
|
const boxPosition = {
|
3145
3149
|
"bottom-right": "hawa-right-4 hawa-bottom-4",
|
3146
3150
|
"bottom-left": "hawa-left-4 hawa-bottom-4"
|
package/dist/index.d.mts
CHANGED
@@ -343,6 +343,7 @@ declare const DialogPortal: {
|
|
343
343
|
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
344
344
|
persist?: boolean | undefined;
|
345
345
|
hideCloseButton?: boolean | undefined;
|
346
|
+
container?: HTMLElement | undefined;
|
346
347
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
347
348
|
declare const DialogCarouselContent: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
348
349
|
hideCloseButton?: boolean | undefined;
|
@@ -559,6 +560,7 @@ type ComboboxTypes<T> = {
|
|
559
560
|
/** If true, it will show a red asterisk next to the label*/
|
560
561
|
isRequired?: boolean;
|
561
562
|
onChange?: (e: any) => void;
|
563
|
+
renderOption?: (item: T) => React$1.ReactNode;
|
562
564
|
};
|
563
565
|
declare const Combobox: React$1.ForwardRefExoticComponent<ComboboxTypes<any> & React$1.RefAttributes<HTMLDivElement>>;
|
564
566
|
|
@@ -723,7 +725,9 @@ declare const CommandShortcut: {
|
|
723
725
|
displayName: string;
|
724
726
|
};
|
725
727
|
|
726
|
-
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> &
|
728
|
+
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
729
|
+
container?: HTMLElement | null | undefined;
|
730
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
727
731
|
interface PopoverProps {
|
728
732
|
side?: PositionType;
|
729
733
|
align?: "start" | "center" | "end";
|
@@ -918,8 +922,7 @@ declare const PasswordInput: React__default.FC<PasswordInputType$1>;
|
|
918
922
|
|
919
923
|
declare const Slider: React$1.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
920
924
|
|
921
|
-
type DataProps = {}
|
922
|
-
type SimpleTableProps = {
|
925
|
+
type SimpleTableProps<DataProps = {}> = {
|
923
926
|
direction?: DirectionType;
|
924
927
|
columns: ColumnDef<DataProps>[];
|
925
928
|
data: DataProps[];
|
@@ -939,9 +942,11 @@ type SimpleTableProps = {
|
|
939
942
|
declare module "@tanstack/table-core" {
|
940
943
|
interface ColumnMeta<TData extends RowData, TValue> {
|
941
944
|
padding?: "condensed" | "default" | "noPadding";
|
945
|
+
sortable?: boolean;
|
946
|
+
hidden?: boolean;
|
942
947
|
}
|
943
948
|
}
|
944
|
-
declare const SimpleTable: React$1.
|
949
|
+
declare const SimpleTable: <DataProps extends {}>({ columns, data, classNames, ...props }: SimpleTableProps<DataProps>) => React$1.JSX.Element;
|
945
950
|
|
946
951
|
type SeparatorProps = {
|
947
952
|
className?: string;
|
package/dist/index.d.ts
CHANGED
@@ -343,6 +343,7 @@ declare const DialogPortal: {
|
|
343
343
|
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
344
344
|
persist?: boolean | undefined;
|
345
345
|
hideCloseButton?: boolean | undefined;
|
346
|
+
container?: HTMLElement | undefined;
|
346
347
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
347
348
|
declare const DialogCarouselContent: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
348
349
|
hideCloseButton?: boolean | undefined;
|
@@ -559,6 +560,7 @@ type ComboboxTypes<T> = {
|
|
559
560
|
/** If true, it will show a red asterisk next to the label*/
|
560
561
|
isRequired?: boolean;
|
561
562
|
onChange?: (e: any) => void;
|
563
|
+
renderOption?: (item: T) => React$1.ReactNode;
|
562
564
|
};
|
563
565
|
declare const Combobox: React$1.ForwardRefExoticComponent<ComboboxTypes<any> & React$1.RefAttributes<HTMLDivElement>>;
|
564
566
|
|
@@ -723,7 +725,9 @@ declare const CommandShortcut: {
|
|
723
725
|
displayName: string;
|
724
726
|
};
|
725
727
|
|
726
|
-
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> &
|
728
|
+
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
729
|
+
container?: HTMLElement | null | undefined;
|
730
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
727
731
|
interface PopoverProps {
|
728
732
|
side?: PositionType;
|
729
733
|
align?: "start" | "center" | "end";
|
@@ -918,8 +922,7 @@ declare const PasswordInput: React__default.FC<PasswordInputType$1>;
|
|
918
922
|
|
919
923
|
declare const Slider: React$1.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
920
924
|
|
921
|
-
type DataProps = {}
|
922
|
-
type SimpleTableProps = {
|
925
|
+
type SimpleTableProps<DataProps = {}> = {
|
923
926
|
direction?: DirectionType;
|
924
927
|
columns: ColumnDef<DataProps>[];
|
925
928
|
data: DataProps[];
|
@@ -939,9 +942,11 @@ type SimpleTableProps = {
|
|
939
942
|
declare module "@tanstack/table-core" {
|
940
943
|
interface ColumnMeta<TData extends RowData, TValue> {
|
941
944
|
padding?: "condensed" | "default" | "noPadding";
|
945
|
+
sortable?: boolean;
|
946
|
+
hidden?: boolean;
|
942
947
|
}
|
943
948
|
}
|
944
|
-
declare const SimpleTable: React$1.
|
949
|
+
declare const SimpleTable: <DataProps extends {}>({ columns, data, classNames, ...props }: SimpleTableProps<DataProps>) => React$1.JSX.Element;
|
945
950
|
|
946
951
|
type SeparatorProps = {
|
947
952
|
className?: string;
|
package/dist/index.js
CHANGED
@@ -1900,7 +1900,7 @@ var DialogOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
1900
1900
|
...props
|
1901
1901
|
}
|
1902
1902
|
));
|
1903
|
-
var DialogContent = React14.forwardRef(({ className, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React14.createElement(DialogPortal,
|
1903
|
+
var DialogContent = React14.forwardRef(({ className, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React14.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React14.createElement(DialogOverlay, null), /* @__PURE__ */ React14.createElement(
|
1904
1904
|
DialogPrimitive.Content,
|
1905
1905
|
{
|
1906
1906
|
onPointerDownOutside: (e) => {
|
@@ -3423,72 +3423,10 @@ var Radio = ({
|
|
3423
3423
|
var React27 = __toESM(require("react"));
|
3424
3424
|
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
|
3425
3425
|
|
3426
|
-
// elements/popover/Popover.tsx
|
3427
|
-
var React25 = __toESM(require("react"));
|
3428
|
-
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
3429
|
-
var PopoverContent = React25.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React25.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React25.createElement(
|
3430
|
-
PopoverPrimitive.Content,
|
3431
|
-
{
|
3432
|
-
ref,
|
3433
|
-
align,
|
3434
|
-
sideOffset,
|
3435
|
-
className: cn(
|
3436
|
-
"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",
|
3437
|
-
className
|
3438
|
-
),
|
3439
|
-
...props
|
3440
|
-
}
|
3441
|
-
)));
|
3442
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
3443
|
-
var Popover = ({
|
3444
|
-
trigger,
|
3445
|
-
children,
|
3446
|
-
className,
|
3447
|
-
align = "center",
|
3448
|
-
side,
|
3449
|
-
sideOffset = 4,
|
3450
|
-
open,
|
3451
|
-
width = "default",
|
3452
|
-
disableTrigger,
|
3453
|
-
contentProps,
|
3454
|
-
triggerProps,
|
3455
|
-
...props
|
3456
|
-
}) => {
|
3457
|
-
let widthStyles = {
|
3458
|
-
trigger: "var(--radix-popover-trigger-width)",
|
3459
|
-
default: "auto"
|
3460
|
-
};
|
3461
|
-
return /* @__PURE__ */ React25.createElement(PopoverPrimitive.Root, { open, ...props }, /* @__PURE__ */ React25.createElement(
|
3462
|
-
PopoverPrimitive.Trigger,
|
3463
|
-
{
|
3464
|
-
className: "hawa-w-full",
|
3465
|
-
disabled: disableTrigger,
|
3466
|
-
...triggerProps
|
3467
|
-
},
|
3468
|
-
trigger
|
3469
|
-
), /* @__PURE__ */ React25.createElement(
|
3470
|
-
PopoverContent,
|
3471
|
-
{
|
3472
|
-
side,
|
3473
|
-
className,
|
3474
|
-
align,
|
3475
|
-
sideOffset,
|
3476
|
-
style: {
|
3477
|
-
width: widthStyles[width],
|
3478
|
-
maxWidth: "var(--radix-popover-content-available-width)",
|
3479
|
-
maxHeight: "var(--radix-popover-content-available-height)"
|
3480
|
-
},
|
3481
|
-
...contentProps
|
3482
|
-
},
|
3483
|
-
children
|
3484
|
-
));
|
3485
|
-
};
|
3486
|
-
var PopoverTrigger = PopoverPrimitive.Trigger;
|
3487
|
-
|
3488
3426
|
// elements/command/Command.tsx
|
3489
|
-
var
|
3427
|
+
var React25 = __toESM(require("react"));
|
3490
3428
|
var import_cmdk = require("cmdk");
|
3491
|
-
var Command =
|
3429
|
+
var Command = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
3492
3430
|
import_cmdk.Command,
|
3493
3431
|
{
|
3494
3432
|
ref,
|
@@ -3501,15 +3439,15 @@ var Command = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
3501
3439
|
));
|
3502
3440
|
Command.displayName = import_cmdk.Command.displayName;
|
3503
3441
|
var CommandDialog = ({ children, ...props }) => {
|
3504
|
-
return /* @__PURE__ */
|
3442
|
+
return /* @__PURE__ */ React25.createElement(Dialog, { ...props }, /* @__PURE__ */ React25.createElement(DialogContent, { className: "hawa-overflow-hidden hawa-p-0 hawa-shadow-lg" }, /* @__PURE__ */ React25.createElement(Command, { className: "[&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:hawa-pt-0 [&_[cmdk-group]]:hawa-px-2 [&_[cmdk-input-wrapper]_svg]:hawa-h-5 [&_[cmdk-input-wrapper]_svg]:hawa-w-5 [&_[cmdk-input]]:hawa-h-12 [&_[cmdk-item]]:hawa-px-2 [&_[cmdk-item]]:hawa-py-3 [&_[cmdk-item]_svg]:hawa-h-5 [&_[cmdk-item]_svg]:hawa-w-5" }, children)));
|
3505
3443
|
};
|
3506
|
-
var CommandInput =
|
3444
|
+
var CommandInput = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
3507
3445
|
"div",
|
3508
3446
|
{
|
3509
3447
|
className: "hawa-flex hawa-items-center hawa-border-b hawa-px-3",
|
3510
3448
|
"cmdk-input-wrapper": ""
|
3511
3449
|
},
|
3512
|
-
/* @__PURE__ */
|
3450
|
+
/* @__PURE__ */ React25.createElement(
|
3513
3451
|
"svg",
|
3514
3452
|
{
|
3515
3453
|
"aria-label": "Search Icon",
|
@@ -3524,10 +3462,10 @@ var CommandInput = React26.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
3524
3462
|
strokeLinejoin: "round",
|
3525
3463
|
className: "hawa-icon hawa-me-2 hawa-shrink-0 hawa-opacity-50"
|
3526
3464
|
},
|
3527
|
-
/* @__PURE__ */
|
3528
|
-
/* @__PURE__ */
|
3465
|
+
/* @__PURE__ */ React25.createElement("circle", { cx: "11", cy: "11", r: "8" }),
|
3466
|
+
/* @__PURE__ */ React25.createElement("path", { d: "m21 21-4.3-4.3" })
|
3529
3467
|
),
|
3530
|
-
/* @__PURE__ */
|
3468
|
+
/* @__PURE__ */ React25.createElement(
|
3531
3469
|
import_cmdk.Command.Input,
|
3532
3470
|
{
|
3533
3471
|
ref,
|
@@ -3540,7 +3478,7 @@ var CommandInput = React26.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
3540
3478
|
)
|
3541
3479
|
));
|
3542
3480
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
3543
|
-
var CommandList =
|
3481
|
+
var CommandList = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
3544
3482
|
import_cmdk.Command.List,
|
3545
3483
|
{
|
3546
3484
|
ref,
|
@@ -3552,7 +3490,7 @@ var CommandList = React26.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
3552
3490
|
}
|
3553
3491
|
));
|
3554
3492
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
3555
|
-
var CommandEmpty =
|
3493
|
+
var CommandEmpty = React25.forwardRef((props, ref) => /* @__PURE__ */ React25.createElement(
|
3556
3494
|
import_cmdk.Command.Empty,
|
3557
3495
|
{
|
3558
3496
|
ref,
|
@@ -3561,7 +3499,7 @@ var CommandEmpty = React26.forwardRef((props, ref) => /* @__PURE__ */ React26.cr
|
|
3561
3499
|
}
|
3562
3500
|
));
|
3563
3501
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
3564
|
-
var CommandGroup =
|
3502
|
+
var CommandGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
3565
3503
|
import_cmdk.Command.Group,
|
3566
3504
|
{
|
3567
3505
|
ref,
|
@@ -3573,7 +3511,7 @@ var CommandGroup = React26.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
3573
3511
|
}
|
3574
3512
|
));
|
3575
3513
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
3576
|
-
var CommandSeparator =
|
3514
|
+
var CommandSeparator = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
3577
3515
|
import_cmdk.Command.Separator,
|
3578
3516
|
{
|
3579
3517
|
ref,
|
@@ -3582,7 +3520,7 @@ var CommandSeparator = React26.forwardRef(({ className, ...props }, ref) => /* @
|
|
3582
3520
|
}
|
3583
3521
|
));
|
3584
3522
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
3585
|
-
var CommandItem =
|
3523
|
+
var CommandItem = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
3586
3524
|
import_cmdk.Command.Item,
|
3587
3525
|
{
|
3588
3526
|
ref,
|
@@ -3598,7 +3536,7 @@ var CommandShortcut = ({
|
|
3598
3536
|
className,
|
3599
3537
|
...props
|
3600
3538
|
}) => {
|
3601
|
-
return /* @__PURE__ */
|
3539
|
+
return /* @__PURE__ */ React25.createElement(
|
3602
3540
|
"span",
|
3603
3541
|
{
|
3604
3542
|
className: cn(
|
@@ -3611,6 +3549,70 @@ var CommandShortcut = ({
|
|
3611
3549
|
};
|
3612
3550
|
CommandShortcut.displayName = "CommandShortcut";
|
3613
3551
|
|
3552
|
+
// elements/popover/Popover.tsx
|
3553
|
+
var React26 = __toESM(require("react"));
|
3554
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
3555
|
+
var PopoverContent = React26.forwardRef(
|
3556
|
+
({ className, align = "center", sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */ React26.createElement(PopoverPrimitive.Portal, { container }, /* @__PURE__ */ React26.createElement(
|
3557
|
+
PopoverPrimitive.Content,
|
3558
|
+
{
|
3559
|
+
ref,
|
3560
|
+
align,
|
3561
|
+
sideOffset,
|
3562
|
+
className: cn(
|
3563
|
+
"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",
|
3564
|
+
className
|
3565
|
+
),
|
3566
|
+
...props
|
3567
|
+
}
|
3568
|
+
))
|
3569
|
+
);
|
3570
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
3571
|
+
var Popover = ({
|
3572
|
+
trigger,
|
3573
|
+
children,
|
3574
|
+
className,
|
3575
|
+
align = "center",
|
3576
|
+
side,
|
3577
|
+
sideOffset = 4,
|
3578
|
+
open,
|
3579
|
+
width = "default",
|
3580
|
+
disableTrigger,
|
3581
|
+
contentProps,
|
3582
|
+
triggerProps,
|
3583
|
+
...props
|
3584
|
+
}) => {
|
3585
|
+
let widthStyles = {
|
3586
|
+
trigger: "var(--radix-popover-trigger-width)",
|
3587
|
+
default: "auto"
|
3588
|
+
};
|
3589
|
+
return /* @__PURE__ */ React26.createElement(PopoverPrimitive.Root, { open, ...props }, /* @__PURE__ */ React26.createElement(
|
3590
|
+
PopoverPrimitive.Trigger,
|
3591
|
+
{
|
3592
|
+
className: "hawa-w-full",
|
3593
|
+
disabled: disableTrigger,
|
3594
|
+
...triggerProps
|
3595
|
+
},
|
3596
|
+
trigger
|
3597
|
+
), /* @__PURE__ */ React26.createElement(
|
3598
|
+
PopoverContent,
|
3599
|
+
{
|
3600
|
+
side,
|
3601
|
+
className,
|
3602
|
+
align,
|
3603
|
+
sideOffset,
|
3604
|
+
style: {
|
3605
|
+
width: widthStyles[width],
|
3606
|
+
maxWidth: "var(--radix-popover-content-available-width)",
|
3607
|
+
maxHeight: "var(--radix-popover-content-available-height)"
|
3608
|
+
},
|
3609
|
+
...contentProps
|
3610
|
+
},
|
3611
|
+
children
|
3612
|
+
));
|
3613
|
+
};
|
3614
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
3615
|
+
|
3614
3616
|
// elements/combobox/Combobox.tsx
|
3615
3617
|
var Combobox = React27.forwardRef(
|
3616
3618
|
({
|
@@ -3621,11 +3623,13 @@ var Combobox = React27.forwardRef(
|
|
3621
3623
|
direction,
|
3622
3624
|
labelProps,
|
3623
3625
|
data,
|
3626
|
+
renderOption,
|
3624
3627
|
...props
|
3625
3628
|
}, ref) => {
|
3626
3629
|
var _a, _b, _c;
|
3627
3630
|
const [open, setOpen] = React27.useState(false);
|
3628
3631
|
const [value, setValue] = React27.useState(defaultValue);
|
3632
|
+
const containerRef = React27.useRef(null);
|
3629
3633
|
function getProperty(obj, key) {
|
3630
3634
|
return obj[key];
|
3631
3635
|
}
|
@@ -3640,7 +3644,8 @@ var Combobox = React27.forwardRef(
|
|
3640
3644
|
className: cn(
|
3641
3645
|
"hawa-relative hawa-flex hawa-h-fit hawa-flex-col hawa-gap-2",
|
3642
3646
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
3643
|
-
)
|
3647
|
+
),
|
3648
|
+
ref: containerRef
|
3644
3649
|
},
|
3645
3650
|
props.label && /* @__PURE__ */ React27.createElement(Label2, { ...labelProps }, props.label),
|
3646
3651
|
/* @__PURE__ */ React27.createElement(PopoverPrimitive2.Root, { open, onOpenChange: handleOpenChange }, /* @__PURE__ */ React27.createElement(PopoverTrigger, { asChild: true }, props.isLoading ? /* @__PURE__ */ React27.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React27.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-start hawa-gap-2 " }, /* @__PURE__ */ React27.createElement(
|
@@ -3698,7 +3703,8 @@ var Combobox = React27.forwardRef(
|
|
3698
3703
|
{
|
3699
3704
|
sideOffset: 0,
|
3700
3705
|
className: cn("popover-w-parent", props.helperText && "-hawa-mt-4"),
|
3701
|
-
dir: direction
|
3706
|
+
dir: direction,
|
3707
|
+
container: containerRef.current
|
3702
3708
|
},
|
3703
3709
|
/* @__PURE__ */ React27.createElement(Command, null, !props.hideInput && /* @__PURE__ */ React27.createElement(
|
3704
3710
|
CommandInput,
|
@@ -3706,7 +3712,7 @@ var Combobox = React27.forwardRef(
|
|
3706
3712
|
dir: direction,
|
3707
3713
|
placeholder: ((_b = props.texts) == null ? void 0 : _b.searchPlaceholder) || "Search"
|
3708
3714
|
}
|
3709
|
-
), /* @__PURE__ */ React27.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."), /* @__PURE__ */ React27.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-
|
3715
|
+
), /* @__PURE__ */ React27.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."), /* @__PURE__ */ React27.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-scroll" }, data.map((item, i) => /* @__PURE__ */ React27.createElement(
|
3710
3716
|
CommandItem,
|
3711
3717
|
{
|
3712
3718
|
key: i,
|
@@ -3742,7 +3748,7 @@ var Combobox = React27.forwardRef(
|
|
3742
3748
|
},
|
3743
3749
|
/* @__PURE__ */ React27.createElement("polyline", { points: "20 6 9 17 4 12" })
|
3744
3750
|
),
|
3745
|
-
getProperty(item, labelKey)
|
3751
|
+
renderOption ? renderOption(item) : getProperty(item, labelKey)
|
3746
3752
|
))))
|
3747
3753
|
))
|
3748
3754
|
);
|