@sikka/hawa 0.30.21-next → 0.30.23-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.
@@ -1,4 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { CommandInputProps } from '../command/index.mjs';
3
+ import '@radix-ui/react-dialog';
4
+ import 'cmdk';
2
5
 
3
6
  type DirectionType = "rtl" | "ltr";
4
7
  type PositionType = "top" | "bottom" | "right" | "left";
@@ -11,8 +14,8 @@ type LabelProps = {
11
14
  };
12
15
 
13
16
  type ComboboxTypes<T> = {
14
- labelKey?: keyof T;
15
- valueKey?: keyof T;
17
+ labelKey?: keyof T | any;
18
+ valueKey?: keyof T | any;
16
19
  data: T[];
17
20
  width?: string;
18
21
  texts?: {
@@ -28,6 +31,7 @@ type ComboboxTypes<T> = {
28
31
  preview?: boolean;
29
32
  hideInput?: boolean;
30
33
  direction?: DirectionType;
34
+ inputProps?: CommandInputProps;
31
35
  id?: string;
32
36
  /** The label of the input field */
33
37
  label?: any;
@@ -1,4 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { CommandInputProps } from '../command/index.js';
3
+ import '@radix-ui/react-dialog';
4
+ import 'cmdk';
2
5
 
3
6
  type DirectionType = "rtl" | "ltr";
4
7
  type PositionType = "top" | "bottom" | "right" | "left";
@@ -11,8 +14,8 @@ type LabelProps = {
11
14
  };
12
15
 
13
16
  type ComboboxTypes<T> = {
14
- labelKey?: keyof T;
15
- valueKey?: keyof T;
17
+ labelKey?: keyof T | any;
18
+ valueKey?: keyof T | any;
16
19
  data: T[];
17
20
  width?: string;
18
21
  texts?: {
@@ -28,6 +31,7 @@ type ComboboxTypes<T> = {
28
31
  preview?: boolean;
29
32
  hideInput?: boolean;
30
33
  direction?: DirectionType;
34
+ inputProps?: CommandInputProps;
31
35
  id?: string;
32
36
  /** The label of the input field */
33
37
  label?: any;
@@ -646,6 +646,7 @@ var Combobox = React7.forwardRef(
646
646
  popoverClassName,
647
647
  direction,
648
648
  labelProps,
649
+ inputProps,
649
650
  data,
650
651
  renderOption,
651
652
  ...props
@@ -655,7 +656,7 @@ var Combobox = React7.forwardRef(
655
656
  const [value, setValue] = React7.useState(defaultValue);
656
657
  const containerRef = React7.useRef(null);
657
658
  function getProperty(obj, key) {
658
- return obj[key];
659
+ return key.split(".").reduce((o, k) => (o || {})[k], obj);
659
660
  }
660
661
  const handleOpenChange = (open2) => {
661
662
  if (!(props.isLoading || props.preview)) {
@@ -730,52 +731,65 @@ var Combobox = React7.forwardRef(
730
731
  dir: direction,
731
732
  container: containerRef.current
732
733
  },
733
- /* @__PURE__ */ React7.createElement(Command, null, !props.hideInput && /* @__PURE__ */ React7.createElement(
734
- CommandInput,
735
- {
736
- dir: direction,
737
- placeholder: ((_b = props.texts) == null ? void 0 : _b.searchPlaceholder) || "Search"
738
- }
739
- ), /* @__PURE__ */ React7.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."), /* @__PURE__ */ React7.createElement(CommandList, null, /* @__PURE__ */ React7.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-scroll" }, data.map((item, i) => /* @__PURE__ */ React7.createElement(
740
- CommandItem,
734
+ /* @__PURE__ */ React7.createElement(
735
+ Command,
741
736
  {
742
- key: i,
743
- onSelect: () => {
744
- const newValue = getProperty(item, valueKey);
745
- setValue(
746
- newValue === value ? "" : newValue
747
- );
748
- if (props.onChange) {
749
- props.onChange(
750
- newValue === value ? "" : newValue
751
- );
752
- }
753
- setOpen(false);
737
+ filter: (value2, search) => {
738
+ if (value2.toLowerCase().includes(search.toLowerCase()))
739
+ return 1;
740
+ return 0;
754
741
  }
755
742
  },
756
- /* @__PURE__ */ React7.createElement(
757
- "svg",
743
+ !props.hideInput && /* @__PURE__ */ React7.createElement(
744
+ CommandInput,
758
745
  {
759
- "aria-label": "Check Icon",
760
- xmlns: "http://www.w3.org/2000/svg",
761
- width: "24",
762
- height: "24",
763
- viewBox: "0 0 24 24",
764
- fill: "none",
765
- stroke: "currentColor",
766
- strokeWidth: "2",
767
- strokeLinecap: "round",
768
- strokeLinejoin: "round",
769
- className: cn(
770
- "hawa-icon",
771
- value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
772
- ),
773
- style: { marginInlineEnd: "0.5rem" }
774
- },
775
- /* @__PURE__ */ React7.createElement("polyline", { points: "20 6 9 17 4 12" })
746
+ ...inputProps,
747
+ dir: direction,
748
+ placeholder: ((_b = props.texts) == null ? void 0 : _b.searchPlaceholder) || "Search"
749
+ }
776
750
  ),
777
- renderOption ? renderOption(item) : getProperty(item, labelKey)
778
- )))))
751
+ /* @__PURE__ */ React7.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."),
752
+ /* @__PURE__ */ React7.createElement(CommandList, null, /* @__PURE__ */ React7.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-scroll" }, data.map((item, i) => /* @__PURE__ */ React7.createElement(
753
+ CommandItem,
754
+ {
755
+ key: i,
756
+ onSelect: () => {
757
+ const newValue = getProperty(item, valueKey);
758
+ setValue(
759
+ newValue === value ? "" : newValue
760
+ );
761
+ if (props.onChange) {
762
+ props.onChange(
763
+ newValue === value ? "" : newValue
764
+ );
765
+ }
766
+ setOpen(false);
767
+ }
768
+ },
769
+ /* @__PURE__ */ React7.createElement(
770
+ "svg",
771
+ {
772
+ "aria-label": "Check Icon",
773
+ xmlns: "http://www.w3.org/2000/svg",
774
+ width: "24",
775
+ height: "24",
776
+ viewBox: "0 0 24 24",
777
+ fill: "none",
778
+ stroke: "currentColor",
779
+ strokeWidth: "2",
780
+ strokeLinecap: "round",
781
+ strokeLinejoin: "round",
782
+ className: cn(
783
+ "hawa-icon",
784
+ value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
785
+ ),
786
+ style: { marginInlineEnd: "0.5rem" }
787
+ },
788
+ /* @__PURE__ */ React7.createElement("polyline", { points: "20 6 9 17 4 12" })
789
+ ),
790
+ renderOption ? renderOption(item) : getProperty(item, labelKey)
791
+ ))))
792
+ )
779
793
  ))
780
794
  );
781
795
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/combobox/index.ts","../../elements/combobox/Combobox.tsx","../../util/index.ts","../../elements/command/Command.tsx","../../elements/dialog/Dialog.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/popover/Popover.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Combobox\";\n","import * as React from \"react\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"../command\";\nimport { Label, LabelProps } from \"../label\";\nimport { PopoverContent, PopoverTrigger } from \"../popover\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ComboboxTypes<T> = {\n labelKey?: keyof T;\n valueKey?: keyof T;\n data: T[];\n width?: string;\n texts?: {\n noItems?: string;\n placeholder?: string;\n searchPlaceholder?: string;\n };\n isLoading?: boolean;\n helperText?: string;\n popoverClassName?: string;\n /** This the same value as the one with the key valueKey */\n defaultValue?: string;\n preview?: boolean;\n hideInput?: boolean;\n direction?: DirectionType;\n id?: string;\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n /** If true, it will show a red asterisk next to the label*/\n isRequired?: boolean;\n onChange?: (e: any) => void;\n renderOption?: (item: T) => React.ReactNode;\n};\n\nexport const Combobox = React.forwardRef<HTMLDivElement, ComboboxTypes<any>>(\n (\n {\n labelKey = \"label\",\n valueKey = \"value\",\n defaultValue = \"\",\n popoverClassName,\n direction,\n labelProps,\n data,\n renderOption,\n ...props\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const [value, setValue] = React.useState(defaultValue);\n const containerRef = React.useRef<HTMLDivElement>(null);\n function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {\n return obj[key];\n }\n const handleOpenChange = (open: boolean) => {\n if (!(props.isLoading || props.preview)) {\n setOpen(open);\n }\n };\n return (\n <div\n className={cn(\n \"hawa-relative hawa-flex hawa-h-fit hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n ref={containerRef}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n {props.isLoading ? (\n <div className=\"hawa-pb-2\">\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n </div>\n ) : (\n <div className=\"hawa-flex hawa-flex-col hawa-items-start hawa-gap-2 \">\n <div\n className={cn(\n \"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800\",\n props.preview ? \"hawa-opacity-100\" : \"hawa-opacity-0\",\n )}\n ></div>\n <button\n role=\"combobox\"\n type=\"button\"\n aria-expanded={open}\n className={cn(\n \"hawa-inline-flex hawa-h-10 hawa-w-full hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-md hawa-border hawa-py-2 hawa-text-sm hawa-font-normal 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\",\n props.preview\n ? \"hawa-cursor-default hawa-rounded-none hawa-border-transparent hawa-px-0\"\n : \"hawa-bg-background hawa-px-3 \",\n )}\n >\n {value\n ? getProperty(\n data.find((item: any) => item[valueKey] === value) ||\n {},\n labelKey,\n )\n : props.texts?.placeholder || \". . .\"}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\n \"hawa-icon hawa-transition-all\",\n !props.preview\n ? \"hawa-visible hawa-opacity-100\"\n : \"hawa-invisible hawa-opacity-0\",\n )}\n aria-label=\"Chevron down icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n props.helperText\n ? \"hawa-h-4 hawa-opacity-100\"\n : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {props.helperText}\n </p>\n </div>\n )}\n </PopoverTrigger>\n <PopoverContent\n sideOffset={0}\n className={cn(\"popover-w-parent\", props.helperText && \"-hawa-mt-4\")}\n dir={direction}\n container={containerRef.current}\n >\n <Command>\n {!props.hideInput && (\n <CommandInput\n dir={direction}\n placeholder={props.texts?.searchPlaceholder || \"Search\"}\n />\n )}\n <CommandEmpty>\n {props.texts?.noItems || \"No items found.\"}\n </CommandEmpty>\n <CommandList>\n <CommandGroup className=\"hawa-max-h-[200px] hawa-overflow-y-scroll\">\n {data.map((item: any, i) => (\n <CommandItem\n key={i}\n onSelect={() => {\n const newValue = getProperty(item, valueKey);\n setValue(\n newValue === value ? \"\" : (newValue as string),\n );\n if (props.onChange) {\n props.onChange(\n newValue === value ? \"\" : (newValue as string),\n );\n }\n setOpen(false);\n }}\n >\n <svg\n aria-label=\"Check Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\n \"hawa-icon\",\n value === getProperty(item, valueKey)\n ? \"hawa-opacity-100\"\n : \"hawa-opacity-0\",\n )}\n style={{ marginInlineEnd: \"0.5rem\" }}\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n {renderOption\n ? renderOption(item)\n : getProperty(item, labelKey)}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </PopoverPrimitive.Root>\n </div>\n );\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport { DialogProps } from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\nimport { Command as CommandPrimitive } from \"cmdk\";\n\nimport { Dialog, DialogContent } from \"../dialog\";\n\ninterface CommandProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive> {\n // Include additional props if necessary\n}\n\ninterface CommandDialogProps extends DialogProps {}\ninterface CommandInputProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> {}\ninterface CommandListProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> {}\ninterface CommandEmptyProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> {}\ninterface CommandGroupProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> {}\ninterface CommandSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> {}\ninterface CommandItemProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> {}\ninterface CommandShortcutProps extends React.HTMLAttributes<HTMLSpanElement> {}\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n CommandProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-overflow-hidden hawa-rounded-md hawa-bg-popover hawa-text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"hawa-overflow-hidden hawa-p-0 hawa-shadow-lg\">\n <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\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n CommandInputProps\n>(({ className, ...props }, ref) => (\n <div\n className=\"hawa-flex hawa-items-center hawa-border-b hawa-px-3\"\n cmdk-input-wrapper=\"\"\n >\n <svg\n aria-label=\"Search Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon hawa-me-2 hawa-shrink-0 hawa-opacity-50\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-11 hawa-w-full hawa-rounded-md hawa-bg-transparent hawa-py-3 hawa-text-sm hawa-outline-none placeholder:hawa-text-muted-foreground disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n CommandListProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n \"hawa-max-h-[300px] hawa-overflow-y-auto hawa-overflow-x-hidden\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n CommandEmptyProps\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"hawa-py-6 hawa-text-center hawa-text-sm\"\n {...props}\n />\n));\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n CommandGroupProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"hawa-overflow-hidden hawa-p-1 hawa-text-foreground [&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-py-1.5 [&_[cmdk-group-heading]]:hawa-text-xs [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n CommandSeparatorProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-h-px hawa-bg-border\", className)}\n {...props}\n />\n));\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n CommandItemProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none aria-selected:hawa-bg-accent aria-selected:hawa-text-accent-foreground data-[disabled='true']:hawa-pointer-events-none data-[disabled='true']:hawa-opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement> & CommandShortcutProps) => {\n return (\n <span\n className={cn(\n \"hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\n\nCommandShortcut.displayName = \"CommandShortcut\";\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nCommandList.displayName = CommandPrimitive.List.displayName;\nCommand.displayName = CommandPrimitive.displayName;\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import * as React from \"react\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal {...props} />\n);\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm 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\",\n className,\n )}\n {...props}\n />\n));\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n persist?: boolean;\n hideCloseButton?: boolean;\n container?: HTMLElement;\n }\n>(({ className, children, persist, hideCloseButton, ...props }, ref) => (\n <DialogPortal container={props.container}>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 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-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-5 hawa-w-5\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n));\n\nconst DialogCarouselContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n hideCloseButton?: boolean;\n hidePrevButton?: boolean;\n persist?: boolean;\n onPrev?: () => void;\n }\n>(\n (\n {\n className,\n children,\n onPrev,\n persist,\n hideCloseButton,\n hidePrevButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 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-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <div\n className={cn(\n \"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4\",\n onPrev ? \"hawa-justify-between\" : \"hawa-justify-end\",\n )}\n >\n {hidePrevButton ? (\n <div />\n ) : (\n <div\n onClick={onPrev}\n className={cn(\n \"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" && \"hawa-rotate-180\",\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"hawa-h-6 hawa-w-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </div>\n )}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground \",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-6 hawa-w-6\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left\",\n className,\n )}\n {...props}\n />\n);\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-sm hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2\",\n className,\n )}\n {...props}\n />\n);\ninterface DialogCarouselProps {\n children: React.ReactNode;\n stepsApi?: any;\n stepsRef?: any;\n direction?: DirectionType;\n}\nconst DialogCarousel: React.FC<DialogCarouselProps> = ({\n stepsApi,\n stepsRef,\n children,\n direction,\n}) => {\n React.useEffect(() => {\n if (stepsApi) {\n stepsApi.reInit();\n }\n }, [stepsApi, children]);\n return (\n <div className=\"hawa-overflow-hidden\">\n <div ref={stepsRef} dir={direction}>\n <div\n className=\"hawa-flex\"\n style={{\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n className={cn(\n \"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\",\n )}\n key={index}\n >\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\ninterface DialogStepsProps {\n currentStep: string;\n // TODO: update this name\n visibleStepRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}\nconst DialogSteps: React.FC<DialogStepsProps> = ({\n currentStep,\n visibleStepRef,\n children,\n}) => {\n const [dialogHeight, setDialogHeight] = React.useState<any>(null);\n React.useEffect(() => {\n if (visibleStepRef.current) {\n setDialogHeight(visibleStepRef.current.offsetHeight);\n console.log(\"height is \", visibleStepRef.current.offsetHeight);\n }\n }, [currentStep, visibleStepRef]);\n\n return (\n <div\n className=\"hawa-relative hawa-overflow-clip\"\n style={{\n height: dialogHeight || \"fit-content\",\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n ref={currentStep === `step-${index + 1}` ? visibleStepRef : null}\n className={cn(\n currentStep === `step-${index + 1}`\n ? \"hawa-visible hawa-block\"\n : \"hawa-invisible hawa-hidden\",\n )}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\ninterface DialogStepProps {\n id: string;\n children: React.ReactNode;\n className?: string;\n stepRef?: any;\n}\nconst DialogStep: React.FC<DialogStepProps> = ({\n id,\n children,\n className,\n stepRef,\n}) => {\n return (\n <div\n id={id}\n ref={stepRef}\n className={cn(\"hawa-w-full hawa-px-1\", className)}\n >\n {children}\n </div>\n );\n};\ninterface DialogBodyProps {\n children: React.ReactNode;\n className?: string;\n}\nconst DialogBody: React.FC<DialogBodyProps> = ({ children, className }) => {\n return <div className={cn(\"hawa-py-6\", className)}>{children}</div>;\n};\n\nDialogBody.displayName = \"DialogBody\";\nDialogStep.displayName = \"DialogStep\";\nDialogSteps.displayName = \"DialogSteps\";\nDialogCarousel.displayName = \"DialogCarousel\";\nDialogCarouselContent.displayName = \"DialogCarouselContent\";\nDialogHeader.displayName = \"DialogHeader\";\nDialogFooter.displayName = \"DialogFooter\";\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogCarousel,\n DialogCarouselContent,\n DialogSteps,\n DialogStep,\n DialogBody,\n DialogDescription,\n};\n","import * as React from \"react\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault()\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-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\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\"\n },\n className\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\"\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import * as React from \"react\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(\n (\n { className, align = \"center\", sideOffset = 4, container, ...props },\n ref\n ) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"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\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n )\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\ninterface PopoverProps {\n side?: PositionType;\n align?: \"start\" | \"center\" | \"end\";\n trigger?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n sideOffset?: number;\n disableTrigger?: any;\n width?: \"trigger\" | \"default\";\n open?: boolean;\n contentProps?: PopoverPrimitive.PopoverContentProps;\n triggerProps?: PopoverPrimitive.PopoverTriggerProps;\n}\n\ntype HawaPopoverTypes = PopoverProps &\n React.ComponentProps<typeof PopoverPrimitive.Root>;\n\nconst Popover: React.FC<HawaPopoverTypes> = ({\n trigger,\n children,\n className,\n align = \"center\",\n side,\n sideOffset = 4,\n open,\n width = \"default\",\n disableTrigger,\n contentProps,\n triggerProps,\n ...props\n}) => {\n let widthStyles = {\n trigger: \"var(--radix-popover-trigger-width)\",\n default: \"auto\"\n };\n\n return (\n <PopoverPrimitive.Root open={open} {...props}>\n <PopoverPrimitive.Trigger\n className=\"hawa-w-full\"\n disabled={disableTrigger}\n {...triggerProps}\n >\n {trigger}\n </PopoverPrimitive.Trigger>\n <PopoverContent\n side={side}\n className={className}\n align={align}\n sideOffset={sideOffset}\n style={{\n width: widthStyles[width],\n maxWidth: \"var(--radix-popover-content-available-width)\",\n maxHeight: \"var(--radix-popover-content-available-height)\"\n }}\n {...contentProps}\n >\n {children}\n </PopoverContent>\n </PopoverPrimitive.Root>\n );\n};\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\nexport { Popover, PopoverContent, PopoverTrigger };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\"\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \"\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n className\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;AAEvB,IAAAC,oBAAkC;;;ACFlC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,IAAAC,SAAuB;AAIvB,kBAA4C;;;ACJ5C,YAAuB;AAEvB,sBAAiC;AASjC,IAAM,eAAe,CAAC,EAAE,GAAG,MAAM,MAC/B,oCAAiB,wBAAhB,EAAwB,GAAG,OAAO;AAErC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,IAAM,gBAAsB,iBAO1B,CAAC,EAAE,WAAW,UAAU,SAAS,iBAAiB,GAAG,MAAM,GAAG,QAC9D,oCAAC,gBAAa,WAAW,MAAM,aAC7B,oCA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;AAAA,cACN,OAAM;AAAA,cACN,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,QAAO;AAAA,cACP,aAAY;AAAA,cACZ,eAAc;AAAA,cACd,gBAAe;AAAA,cACf,WAAW;AAAA,gBACT;AAAA,gBACA,UAAU,YAAY,MAAM,QAAQ,IAChC,qBACA;AAAA,cACN;AAAA,cACA,OAAO,EAAE,iBAAiB,SAAS;AAAA;AAAA,YAEnC,qCAAC,cAAS,QAAO,kBAAiB;AAAA,UACpC;AAAA,UACC,eACG,aAAa,IAAI,IACjB,YAAY,MAAM,QAAQ;AAAA,QAChC,CACD,CACH,CACF,CACF;AAAA,MACF,CACF;AAAA,IACF;AAAA,EAEJ;AACF;","names":["React","PopoverPrimitive","React","CommandPrimitive","CommandPrimitive","React","React","React","import_react","React","open"]}
1
+ {"version":3,"sources":["../../elements/combobox/index.ts","../../elements/combobox/Combobox.tsx","../../util/index.ts","../../elements/command/Command.tsx","../../elements/dialog/Dialog.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/popover/Popover.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Combobox\";\n","import * as React from \"react\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandInputProps,\n CommandItem,\n CommandList,\n} from \"../command\";\nimport { Label, LabelProps } from \"../label\";\nimport { PopoverContent, PopoverTrigger } from \"../popover\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ComboboxTypes<T> = {\n labelKey?: keyof T | any;\n valueKey?: keyof T | any;\n data: T[];\n width?: string;\n texts?: {\n noItems?: string;\n placeholder?: string;\n searchPlaceholder?: string;\n };\n isLoading?: boolean;\n helperText?: string;\n popoverClassName?: string;\n /** This the same value as the one with the key valueKey */\n defaultValue?: string;\n preview?: boolean;\n hideInput?: boolean;\n direction?: DirectionType;\n inputProps?: CommandInputProps;\n id?: string;\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n /** If true, it will show a red asterisk next to the label*/\n isRequired?: boolean;\n onChange?: (e: any) => void;\n renderOption?: (item: T) => React.ReactNode;\n};\nexport const Combobox = React.forwardRef<HTMLDivElement, ComboboxTypes<any>>(\n (\n {\n labelKey = \"label\",\n valueKey = \"value\",\n defaultValue = \"\",\n popoverClassName,\n direction,\n labelProps,\n inputProps,\n data,\n renderOption,\n ...props\n },\n ref,\n ) => {\n const [open, setOpen] = React.useState(false);\n const [value, setValue] = React.useState(defaultValue);\n const containerRef = React.useRef<HTMLDivElement>(null);\n // function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {\n // return key.split(\".\").reduce((o, k) => (o || {})[k], obj);\n // }\n function getProperty<T>(obj: T, key: string): any {\n return key.split(\".\").reduce((o: any, k: string) => (o || {})[k], obj);\n }\n\n const handleOpenChange = (open: boolean) => {\n if (!(props.isLoading || props.preview)) {\n setOpen(open);\n }\n };\n\n return (\n <div\n className={cn(\n \"hawa-relative hawa-flex hawa-h-fit hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n ref={containerRef}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n {props.isLoading ? (\n <div className=\"hawa-pb-2\">\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n </div>\n ) : (\n <div className=\"hawa-flex hawa-flex-col hawa-items-start hawa-gap-2 \">\n <div\n className={cn(\n \"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800\",\n props.preview ? \"hawa-opacity-100\" : \"hawa-opacity-0\",\n )}\n ></div>\n <button\n role=\"combobox\"\n type=\"button\"\n aria-expanded={open}\n className={cn(\n \"hawa-inline-flex hawa-h-10 hawa-w-full hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-md hawa-border hawa-py-2 hawa-text-sm hawa-font-normal 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\",\n props.preview\n ? \"hawa-cursor-default hawa-rounded-none hawa-border-transparent hawa-px-0\"\n : \"hawa-bg-background hawa-px-3 \",\n )}\n >\n {value\n ? getProperty(\n data.find((item: any) => item[valueKey] === value) ||\n {},\n labelKey,\n )\n : props.texts?.placeholder || \". . .\"}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\n \"hawa-icon hawa-transition-all\",\n !props.preview\n ? \"hawa-visible hawa-opacity-100\"\n : \"hawa-invisible hawa-opacity-0\",\n )}\n aria-label=\"Chevron down icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n props.helperText\n ? \"hawa-h-4 hawa-opacity-100\"\n : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {props.helperText}\n </p>\n </div>\n )}\n </PopoverTrigger>\n <PopoverContent\n sideOffset={0}\n className={cn(\"popover-w-parent\", props.helperText && \"-hawa-mt-4\")}\n dir={direction}\n container={containerRef.current}\n >\n <Command\n filter={(value, search) => {\n if (value.toLowerCase().includes(search.toLowerCase()))\n return 1;\n return 0;\n }}\n >\n {!props.hideInput && (\n <CommandInput\n {...inputProps}\n dir={direction}\n placeholder={props.texts?.searchPlaceholder || \"Search\"}\n />\n )}\n <CommandEmpty>\n {props.texts?.noItems || \"No items found.\"}\n </CommandEmpty>\n <CommandList>\n <CommandGroup className=\"hawa-max-h-[200px] hawa-overflow-y-scroll\">\n {data.map((item: any, i) => (\n <CommandItem\n key={i}\n onSelect={() => {\n const newValue = getProperty(item, valueKey);\n setValue(\n newValue === value ? \"\" : (newValue as string),\n );\n if (props.onChange) {\n props.onChange(\n newValue === value ? \"\" : (newValue as string),\n );\n }\n setOpen(false);\n }}\n >\n <svg\n aria-label=\"Check Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\n \"hawa-icon\",\n value === getProperty(item, valueKey)\n ? \"hawa-opacity-100\"\n : \"hawa-opacity-0\",\n )}\n style={{ marginInlineEnd: \"0.5rem\" }}\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n {renderOption\n ? renderOption(item)\n : getProperty(item, labelKey)}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </PopoverPrimitive.Root>\n </div>\n );\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport { DialogProps } from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\nimport { Command as CommandPrimitive } from \"cmdk\";\n\nimport { Dialog, DialogContent } from \"../dialog\";\n\ninterface CommandProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive> {\n // Include additional props if necessary\n}\n\ninterface CommandDialogProps extends DialogProps {}\n\nexport interface CommandInputProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> {}\n\ninterface CommandListProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> {}\n\ninterface CommandEmptyProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> {}\n\ninterface CommandGroupProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> {}\n\ninterface CommandSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> {}\n\ninterface CommandItemProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> {}\n\ninterface CommandShortcutProps extends React.HTMLAttributes<HTMLSpanElement> {}\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n CommandProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-overflow-hidden hawa-rounded-md hawa-bg-popover hawa-text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"hawa-overflow-hidden hawa-p-0 hawa-shadow-lg\">\n <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\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n CommandInputProps\n>(({ className, ...props }, ref) => (\n <div\n className=\"hawa-flex hawa-items-center hawa-border-b hawa-px-3\"\n cmdk-input-wrapper=\"\"\n >\n <svg\n aria-label=\"Search Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon hawa-me-2 hawa-shrink-0 hawa-opacity-50\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-11 hawa-w-full hawa-rounded-md hawa-bg-transparent hawa-py-3 hawa-text-sm hawa-outline-none placeholder:hawa-text-muted-foreground disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n CommandListProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n \"hawa-max-h-[300px] hawa-overflow-y-auto hawa-overflow-x-hidden\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n CommandEmptyProps\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"hawa-py-6 hawa-text-center hawa-text-sm\"\n {...props}\n />\n));\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n CommandGroupProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"hawa-overflow-hidden hawa-p-1 hawa-text-foreground [&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-py-1.5 [&_[cmdk-group-heading]]:hawa-text-xs [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n CommandSeparatorProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-h-px hawa-bg-border\", className)}\n {...props}\n />\n));\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n CommandItemProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none aria-selected:hawa-bg-accent aria-selected:hawa-text-accent-foreground data-[disabled='true']:hawa-pointer-events-none data-[disabled='true']:hawa-opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement> & CommandShortcutProps) => {\n return (\n <span\n className={cn(\n \"hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\n\nCommandShortcut.displayName = \"CommandShortcut\";\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nCommandList.displayName = CommandPrimitive.List.displayName;\nCommand.displayName = CommandPrimitive.displayName;\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import * as React from \"react\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal {...props} />\n);\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm 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\",\n className,\n )}\n {...props}\n />\n));\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n persist?: boolean;\n hideCloseButton?: boolean;\n container?: HTMLElement;\n }\n>(({ className, children, persist, hideCloseButton, ...props }, ref) => (\n <DialogPortal container={props.container}>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 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-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-5 hawa-w-5\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n));\n\nconst DialogCarouselContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n hideCloseButton?: boolean;\n hidePrevButton?: boolean;\n persist?: boolean;\n onPrev?: () => void;\n }\n>(\n (\n {\n className,\n children,\n onPrev,\n persist,\n hideCloseButton,\n hidePrevButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 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-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <div\n className={cn(\n \"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4\",\n onPrev ? \"hawa-justify-between\" : \"hawa-justify-end\",\n )}\n >\n {hidePrevButton ? (\n <div />\n ) : (\n <div\n onClick={onPrev}\n className={cn(\n \"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" && \"hawa-rotate-180\",\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"hawa-h-6 hawa-w-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </div>\n )}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground \",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-6 hawa-w-6\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left\",\n className,\n )}\n {...props}\n />\n);\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-sm hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2\",\n className,\n )}\n {...props}\n />\n);\ninterface DialogCarouselProps {\n children: React.ReactNode;\n stepsApi?: any;\n stepsRef?: any;\n direction?: DirectionType;\n}\nconst DialogCarousel: React.FC<DialogCarouselProps> = ({\n stepsApi,\n stepsRef,\n children,\n direction,\n}) => {\n React.useEffect(() => {\n if (stepsApi) {\n stepsApi.reInit();\n }\n }, [stepsApi, children]);\n return (\n <div className=\"hawa-overflow-hidden\">\n <div ref={stepsRef} dir={direction}>\n <div\n className=\"hawa-flex\"\n style={{\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n className={cn(\n \"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\",\n )}\n key={index}\n >\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\ninterface DialogStepsProps {\n currentStep: string;\n // TODO: update this name\n visibleStepRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}\nconst DialogSteps: React.FC<DialogStepsProps> = ({\n currentStep,\n visibleStepRef,\n children,\n}) => {\n const [dialogHeight, setDialogHeight] = React.useState<any>(null);\n React.useEffect(() => {\n if (visibleStepRef.current) {\n setDialogHeight(visibleStepRef.current.offsetHeight);\n console.log(\"height is \", visibleStepRef.current.offsetHeight);\n }\n }, [currentStep, visibleStepRef]);\n\n return (\n <div\n className=\"hawa-relative hawa-overflow-clip\"\n style={{\n height: dialogHeight || \"fit-content\",\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n ref={currentStep === `step-${index + 1}` ? visibleStepRef : null}\n className={cn(\n currentStep === `step-${index + 1}`\n ? \"hawa-visible hawa-block\"\n : \"hawa-invisible hawa-hidden\",\n )}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\ninterface DialogStepProps {\n id: string;\n children: React.ReactNode;\n className?: string;\n stepRef?: any;\n}\nconst DialogStep: React.FC<DialogStepProps> = ({\n id,\n children,\n className,\n stepRef,\n}) => {\n return (\n <div\n id={id}\n ref={stepRef}\n className={cn(\"hawa-w-full hawa-px-1\", className)}\n >\n {children}\n </div>\n );\n};\ninterface DialogBodyProps {\n children: React.ReactNode;\n className?: string;\n}\nconst DialogBody: React.FC<DialogBodyProps> = ({ children, className }) => {\n return <div className={cn(\"hawa-py-6\", className)}>{children}</div>;\n};\n\nDialogBody.displayName = \"DialogBody\";\nDialogStep.displayName = \"DialogStep\";\nDialogSteps.displayName = \"DialogSteps\";\nDialogCarousel.displayName = \"DialogCarousel\";\nDialogCarouselContent.displayName = \"DialogCarouselContent\";\nDialogHeader.displayName = \"DialogHeader\";\nDialogFooter.displayName = \"DialogFooter\";\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogCarousel,\n DialogCarouselContent,\n DialogSteps,\n DialogStep,\n DialogBody,\n DialogDescription,\n};\n","import * as React from \"react\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault()\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-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\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\"\n },\n className\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\"\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import * as React from \"react\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(\n (\n { className, align = \"center\", sideOffset = 4, container, ...props },\n ref\n ) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"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\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n )\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\ninterface PopoverProps {\n side?: PositionType;\n align?: \"start\" | \"center\" | \"end\";\n trigger?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n sideOffset?: number;\n disableTrigger?: any;\n width?: \"trigger\" | \"default\";\n open?: boolean;\n contentProps?: PopoverPrimitive.PopoverContentProps;\n triggerProps?: PopoverPrimitive.PopoverTriggerProps;\n}\n\ntype HawaPopoverTypes = PopoverProps &\n React.ComponentProps<typeof PopoverPrimitive.Root>;\n\nconst Popover: React.FC<HawaPopoverTypes> = ({\n trigger,\n children,\n className,\n align = \"center\",\n side,\n sideOffset = 4,\n open,\n width = \"default\",\n disableTrigger,\n contentProps,\n triggerProps,\n ...props\n}) => {\n let widthStyles = {\n trigger: \"var(--radix-popover-trigger-width)\",\n default: \"auto\"\n };\n\n return (\n <PopoverPrimitive.Root open={open} {...props}>\n <PopoverPrimitive.Trigger\n className=\"hawa-w-full\"\n disabled={disableTrigger}\n {...triggerProps}\n >\n {trigger}\n </PopoverPrimitive.Trigger>\n <PopoverContent\n side={side}\n className={className}\n align={align}\n sideOffset={sideOffset}\n style={{\n width: widthStyles[width],\n maxWidth: \"var(--radix-popover-content-available-width)\",\n maxHeight: \"var(--radix-popover-content-available-height)\"\n }}\n {...contentProps}\n >\n {children}\n </PopoverContent>\n </PopoverPrimitive.Root>\n );\n};\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\nexport { Popover, PopoverContent, PopoverTrigger };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\"\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \"\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n className\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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,cAAS,QAAO,kBAAiB;AAAA,YACpC;AAAA,YACC,eACG,aAAa,IAAI,IACjB,YAAY,MAAM,QAAQ;AAAA,UAChC,CACD,CACH,CACF;AAAA,QACF;AAAA,MACF,CACF;AAAA,IACF;AAAA,EAEJ;AACF;","names":["React","PopoverPrimitive","React","CommandPrimitive","CommandPrimitive","React","React","React","import_react","React","open","value"]}
@@ -611,6 +611,7 @@ var Combobox = React7.forwardRef(
611
611
  popoverClassName,
612
612
  direction,
613
613
  labelProps,
614
+ inputProps,
614
615
  data,
615
616
  renderOption,
616
617
  ...props
@@ -620,7 +621,7 @@ var Combobox = React7.forwardRef(
620
621
  const [value, setValue] = React7.useState(defaultValue);
621
622
  const containerRef = React7.useRef(null);
622
623
  function getProperty(obj, key) {
623
- return obj[key];
624
+ return key.split(".").reduce((o, k) => (o || {})[k], obj);
624
625
  }
625
626
  const handleOpenChange = (open2) => {
626
627
  if (!(props.isLoading || props.preview)) {
@@ -695,52 +696,65 @@ var Combobox = React7.forwardRef(
695
696
  dir: direction,
696
697
  container: containerRef.current
697
698
  },
698
- /* @__PURE__ */ React7.createElement(Command, null, !props.hideInput && /* @__PURE__ */ React7.createElement(
699
- CommandInput,
700
- {
701
- dir: direction,
702
- placeholder: ((_b = props.texts) == null ? void 0 : _b.searchPlaceholder) || "Search"
703
- }
704
- ), /* @__PURE__ */ React7.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."), /* @__PURE__ */ React7.createElement(CommandList, null, /* @__PURE__ */ React7.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-scroll" }, data.map((item, i) => /* @__PURE__ */ React7.createElement(
705
- CommandItem,
699
+ /* @__PURE__ */ React7.createElement(
700
+ Command,
706
701
  {
707
- key: i,
708
- onSelect: () => {
709
- const newValue = getProperty(item, valueKey);
710
- setValue(
711
- newValue === value ? "" : newValue
712
- );
713
- if (props.onChange) {
714
- props.onChange(
715
- newValue === value ? "" : newValue
716
- );
717
- }
718
- setOpen(false);
702
+ filter: (value2, search) => {
703
+ if (value2.toLowerCase().includes(search.toLowerCase()))
704
+ return 1;
705
+ return 0;
719
706
  }
720
707
  },
721
- /* @__PURE__ */ React7.createElement(
722
- "svg",
708
+ !props.hideInput && /* @__PURE__ */ React7.createElement(
709
+ CommandInput,
723
710
  {
724
- "aria-label": "Check Icon",
725
- xmlns: "http://www.w3.org/2000/svg",
726
- width: "24",
727
- height: "24",
728
- viewBox: "0 0 24 24",
729
- fill: "none",
730
- stroke: "currentColor",
731
- strokeWidth: "2",
732
- strokeLinecap: "round",
733
- strokeLinejoin: "round",
734
- className: cn(
735
- "hawa-icon",
736
- value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
737
- ),
738
- style: { marginInlineEnd: "0.5rem" }
739
- },
740
- /* @__PURE__ */ React7.createElement("polyline", { points: "20 6 9 17 4 12" })
711
+ ...inputProps,
712
+ dir: direction,
713
+ placeholder: ((_b = props.texts) == null ? void 0 : _b.searchPlaceholder) || "Search"
714
+ }
741
715
  ),
742
- renderOption ? renderOption(item) : getProperty(item, labelKey)
743
- )))))
716
+ /* @__PURE__ */ React7.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."),
717
+ /* @__PURE__ */ React7.createElement(CommandList, null, /* @__PURE__ */ React7.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-scroll" }, data.map((item, i) => /* @__PURE__ */ React7.createElement(
718
+ CommandItem,
719
+ {
720
+ key: i,
721
+ onSelect: () => {
722
+ const newValue = getProperty(item, valueKey);
723
+ setValue(
724
+ newValue === value ? "" : newValue
725
+ );
726
+ if (props.onChange) {
727
+ props.onChange(
728
+ newValue === value ? "" : newValue
729
+ );
730
+ }
731
+ setOpen(false);
732
+ }
733
+ },
734
+ /* @__PURE__ */ React7.createElement(
735
+ "svg",
736
+ {
737
+ "aria-label": "Check Icon",
738
+ xmlns: "http://www.w3.org/2000/svg",
739
+ width: "24",
740
+ height: "24",
741
+ viewBox: "0 0 24 24",
742
+ fill: "none",
743
+ stroke: "currentColor",
744
+ strokeWidth: "2",
745
+ strokeLinecap: "round",
746
+ strokeLinejoin: "round",
747
+ className: cn(
748
+ "hawa-icon",
749
+ value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
750
+ ),
751
+ style: { marginInlineEnd: "0.5rem" }
752
+ },
753
+ /* @__PURE__ */ React7.createElement("polyline", { points: "20 6 9 17 4 12" })
754
+ ),
755
+ renderOption ? renderOption(item) : getProperty(item, labelKey)
756
+ ))))
757
+ )
744
758
  ))
745
759
  );
746
760
  }