@sikka/hawa 0.30.23-next → 0.30.25-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.
Files changed (65) hide show
  1. package/dist/{DropdownMenu-sSnQc6fT.d.ts → DropdownMenu-o_-MnT5h.d.mts} +6 -6
  2. package/dist/{DropdownMenu-arqV1gRt.d.mts → DropdownMenu-p-Ha-y2R.d.ts} +6 -6
  3. package/dist/appLayout/index.d.mts +8 -1
  4. package/dist/appLayout/index.d.ts +8 -1
  5. package/dist/appLayout/index.js +31 -0
  6. package/dist/appLayout/index.js.map +1 -1
  7. package/dist/appLayout/index.mjs +35 -4
  8. package/dist/appLayout/index.mjs.map +1 -1
  9. package/dist/appTopbar/index.d.mts +5 -2
  10. package/dist/appTopbar/index.d.ts +5 -2
  11. package/dist/appTopbar/index.js +31 -0
  12. package/dist/appTopbar/index.js.map +1 -1
  13. package/dist/appTopbar/index.mjs +31 -0
  14. package/dist/appTopbar/index.mjs.map +1 -1
  15. package/dist/blocks/index.d.mts +1 -1
  16. package/dist/blocks/index.d.ts +1 -1
  17. package/dist/blocks/index.js +31 -0
  18. package/dist/blocks/index.mjs +2 -2
  19. package/dist/blocks/pricing/index.mjs +3 -3
  20. package/dist/breadcrumb/index.d.mts +7 -5
  21. package/dist/breadcrumb/index.d.ts +7 -5
  22. package/dist/breadcrumb/index.js +36 -12
  23. package/dist/breadcrumb/index.js.map +1 -1
  24. package/dist/breadcrumb/index.mjs +36 -12
  25. package/dist/breadcrumb/index.mjs.map +1 -1
  26. package/dist/{chunk-CXBN42TF.mjs → chunk-7LAUVLVZ.mjs} +1 -1
  27. package/dist/{chunk-HOE4FCIF.mjs → chunk-DGOT2FVH.mjs} +30 -0
  28. package/dist/{chunk-MH5K6NEO.mjs → chunk-TKSAYWDH.mjs} +1 -1
  29. package/dist/combobox/index.js +44 -35
  30. package/dist/combobox/index.js.map +1 -1
  31. package/dist/combobox/index.mjs +44 -35
  32. package/dist/combobox/index.mjs.map +1 -1
  33. package/dist/commonTypes-52DloiYq.d.mts +7 -0
  34. package/dist/commonTypes-52DloiYq.d.ts +7 -0
  35. package/dist/dataTable/index.js +31 -0
  36. package/dist/dataTable/index.js.map +1 -1
  37. package/dist/dataTable/index.mjs +31 -0
  38. package/dist/dataTable/index.mjs.map +1 -1
  39. package/dist/docsLayout/index.d.mts +1 -1
  40. package/dist/docsLayout/index.d.ts +1 -1
  41. package/dist/dropdownMenu/index.d.mts +9 -5
  42. package/dist/dropdownMenu/index.d.ts +9 -5
  43. package/dist/dropdownMenu/index.js +30 -0
  44. package/dist/dropdownMenu/index.js.map +1 -1
  45. package/dist/dropdownMenu/index.mjs +30 -0
  46. package/dist/dropdownMenu/index.mjs.map +1 -1
  47. package/dist/elements/index.d.mts +8 -6
  48. package/dist/elements/index.d.ts +8 -6
  49. package/dist/elements/index.js +101 -47
  50. package/dist/elements/index.mjs +74 -50
  51. package/dist/index.d.mts +12 -10
  52. package/dist/index.d.ts +12 -10
  53. package/dist/index.js +101 -47
  54. package/dist/index.mjs +206 -152
  55. package/dist/layout/index.d.mts +1 -1
  56. package/dist/layout/index.d.ts +1 -1
  57. package/dist/layout/index.js +31 -0
  58. package/dist/layout/index.mjs +2 -2
  59. package/dist/splitButton/index.d.mts +8 -1
  60. package/dist/splitButton/index.d.ts +8 -1
  61. package/dist/splitButton/index.js +31 -0
  62. package/dist/splitButton/index.js.map +1 -1
  63. package/dist/splitButton/index.mjs +31 -0
  64. package/dist/splitButton/index.mjs.map +1 -1
  65. package/package.json +1 -1
@@ -273,6 +273,9 @@ var DropdownMenu = ({
273
273
  default: "hawa-px-2 hawa-py-3 ",
274
274
  sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
275
275
  };
276
+ let [values, setValues] = React.useState(
277
+ items.map((item) => item.currentOption)
278
+ );
276
279
  return /* @__PURE__ */ React.createElement(
277
280
  DropdownMenuRoot,
278
281
  {
@@ -300,11 +303,38 @@ var DropdownMenu = ({
300
303
  },
301
304
  header && header,
302
305
  items && items.map((item, index) => {
306
+ var _a;
303
307
  const ItemLinkComponent = item.slug ? LinkComponent : "a";
304
308
  if (item.itemType === "separator") {
305
309
  return /* @__PURE__ */ React.createElement(DropdownMenuSeparator, { key: index });
306
310
  } else if (item.itemType === "label") {
307
311
  return /* @__PURE__ */ React.createElement(DropdownMenuLabel, { key: index }, item.label);
312
+ } else if (item.itemType === "radio") {
313
+ let dd = item.currentOption;
314
+ return /* @__PURE__ */ React.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React.createElement(
315
+ DropdownMenuSubTrigger,
316
+ {
317
+ dir: direction,
318
+ className: cn(sizeStyles[size])
319
+ },
320
+ item.icon && item.icon,
321
+ item.label && item.label
322
+ ), /* @__PURE__ */ React.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React.createElement(
323
+ DropdownMenuRadioGroup,
324
+ {
325
+ value: values[index],
326
+ onValueChange: (e) => {
327
+ let newValues = [...values];
328
+ newValues[index] = e;
329
+ setValues(newValues);
330
+ console.log("changing to ", e);
331
+ if (item.onOptionChange) {
332
+ item.onOptionChange(e);
333
+ }
334
+ }
335
+ },
336
+ (_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
337
+ )));
308
338
  } else if (item.itemType === "custom") {
309
339
  return /* @__PURE__ */ React.createElement("div", { key: index }, item.content);
310
340
  } else {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/dropdownMenu/index.ts","../../elements/dropdownMenu/DropdownMenu.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./DropdownMenu\";\n","import * as React from \"react\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"../../types/commonTypes\";\n\nconst DropdownMenuRoot = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2\">\n {children}\n </div>{\" \"}\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 16 16\"\n height=\"1em\"\n width=\"1em\"\n className={cn(props.dir === \"rtl\" ? \"hawa-rotate-180\" : \"\")}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z\"\n ></path>\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"hawa-z-50 hawa-min-w-[8rem] hawa-gap-1 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg 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));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.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-p-1 hawa-text-popover-foreground hawa-shadow-md 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 </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n end?: any;\n shortcut?: React.ReactNode;\n badged?: boolean;\n slug?: string;\n LinkComponent?: any;\n }\n>(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {\n return (\n <LinkComponent href={slug}>\n <DropdownMenuPrimitive.Item\n disabled={props.disabled}\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n inset && \"hawa-pl-8\",\n props.end &&\n Array.isArray(props.children) &&\n props.children[1] &&\n \"hawa-gap-6\",\n className,\n )}\n {...props}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 \">\n {props.children}\n </div>\n\n {props.end && props.end}\n {!props.end && props.shortcut && (\n <DropdownMenuShortcut>{props.shortcut}</DropdownMenuShortcut>\n )}\n {!props.end && badged && (\n <div className=\"hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500\" />\n )}\n </DropdownMenuPrimitive.Item>\n </LinkComponent>\n );\n});\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n {/* <Check className=\"h-4 w-4\" /> */}\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height=\"0.60em\"\n width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n aria-label=\"Circle\"\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-h-2 hawa-w-2 hawa-fill-current\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"hawa-text-xs hawa-tracking-widest hawa-opacity-60\",\n className,\n )}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\ntype ExtendedDropdownMenuContentProps = Partial<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n> & {\n // Add any additional types or overrides here, for example:\n // side?: \"left\" | \"right\" | \"top\" | \"bottom\"\n};\ntype ExtendedDropdownMenuTriggerProps = Partial<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>\n> & {\n // Add any additional types or overrides here, for example:\n // side?: \"left\" | \"right\" | \"top\" | \"bottom\"\n};\n\nexport type SubItem = {\n label?: string;\n value?: any;\n icon?: any;\n action?: () => void;\n onMiddleClick?: (e: any) => void;\n highlighted?: boolean;\n disabled?: boolean;\n slug?: string;\n};\nexport type MenuItemType = {\n icon?: React.ReactNode;\n label?: string;\n shortcut?: React.ReactNode;\n badged?: boolean;\n value?: any;\n content?: any;\n slug?: string;\n end?: any;\n presist?: boolean;\n itemType?: \"separator\" | \"label\" | \"custom\";\n action?: () => void;\n highlighted?: boolean;\n subitems?: SubItem[];\n disabled?: boolean;\n onMiddleClick?: (e: any) => void;\n onClick?: any;\n};\ninterface DropdownMenuProps {\n trigger?: any;\n items: MenuItemType[];\n direction?: DirectionType;\n className?: ExtendedDropdownMenuContentProps[\"className\"];\n triggerClassname?: ExtendedDropdownMenuTriggerProps[\"className\"];\n sideOffset?: ExtendedDropdownMenuContentProps[\"sideOffset\"];\n side?: ExtendedDropdownMenuContentProps[\"side\"];\n align?: ExtendedDropdownMenuContentProps[\"align\"];\n alignOffset?: ExtendedDropdownMenuContentProps[\"alignOffset\"];\n width?: \"default\" | \"sm\" | \"lg\" | \"parent\";\n size?: \"default\" | \"sm\";\n onItemSelect?: any;\n onOpenChange?: any;\n header?: React.ReactNode;\n open?: any;\n LinkComponent?: any;\n}\nconst DropdownMenu: React.FC<DropdownMenuProps> = ({\n trigger,\n items,\n direction,\n sideOffset,\n side,\n className,\n triggerClassname,\n align,\n alignOffset,\n onItemSelect,\n size = \"default\",\n width = \"default\",\n header,\n onOpenChange,\n open,\n LinkComponent,\n}) => {\n const widthStyles = {\n default: \"hawa-min-w-[8rem]\",\n sm: \"hawa-w-fit\",\n lg: \"hawa-w-[200px]\",\n parent: \"ddm-w-parent\",\n };\n const sizeStyles = {\n default: \"hawa-px-2 hawa-py-3 \",\n sm: \"hawa-text-xs hawa-px-1.5 hawa-py-1.5 \",\n };\n\n return (\n <DropdownMenuRoot\n onOpenChange={onOpenChange}\n open={open}\n modal={false}\n dir={direction}\n >\n <DropdownMenuTrigger asChild className={triggerClassname}>\n {trigger}\n </DropdownMenuTrigger>\n <DropdownMenuPortal>\n <DropdownMenuContent\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n className,\n widthStyles[width],\n \"hawa-flex hawa-flex-col hawa-gap-1 hawa-overflow-y-auto\",\n )}\n style={{\n maxHeight: \"var(--radix-dropdown-menu-content-available-height)\",\n }}\n >\n {header && header}\n {items &&\n items.map((item, index) => {\n const ItemLinkComponent = item.slug ? LinkComponent : \"a\";\n if (item.itemType === \"separator\") {\n return <DropdownMenuSeparator key={index} />;\n } else if (item.itemType === \"label\") {\n return (\n <DropdownMenuLabel key={index}>\n {item.label}\n </DropdownMenuLabel>\n );\n } else if (item.itemType === \"custom\") {\n return <div key={index}>{item.content}</div>;\n } else {\n return item.subitems ? (\n <DropdownMenuSub key={index}>\n <DropdownMenuSubTrigger\n dir={direction}\n className={cn(sizeStyles[size])}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent>\n {item.subitems.map((subitem, subIndex) => {\n const SubitemLinkComponent = subitem.slug\n ? LinkComponent\n : \"a\";\n return (\n <DropdownMenuItem\n key={subIndex}\n LinkComponent={SubitemLinkComponent}\n slug={subitem.slug}\n disabled={subitem.disabled}\n className={cn(\n sizeStyles[size],\n !item.icon && !item.label\n ? \"hawa-px-0 hawa-py-0 focus:hawa-bg-transparent\"\n : \"focus:hawa-bg-accent\",\n )}\n onMouseDown={(event: any) => {\n if (\n event.button === 1 ||\n (event.button === 0 && event.ctrlKey)\n ) {\n event.preventDefault(); // This line prevents the default behavior of the middle button\n if (subitem.onMiddleClick) {\n subitem.onMiddleClick(item.value);\n }\n }\n }}\n onSelect={() => {\n subitem.action && subitem.action();\n if (onItemSelect) {\n onItemSelect(subitem.value);\n }\n }}\n >\n {subitem.icon && subitem.icon}\n {subitem.label && subitem.label}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSub>\n ) : (\n <DropdownMenuItem\n LinkComponent={ItemLinkComponent}\n slug={item.slug}\n key={index}\n disabled={item.disabled}\n onMouseDown={(event: any) => {\n if (\n event.button === 1 ||\n (event.button === 0 && event.ctrlKey)\n ) {\n event.preventDefault(); // This line prevents the default behavior of the middle button\n if (item.onMiddleClick) {\n item.onMiddleClick(item.value);\n }\n }\n }}\n onClick={(event: any) => {\n if (item.onClick) {\n item.onClick(item.value);\n }\n }}\n onSelect={(e) => {\n if (item.presist) {\n e.preventDefault();\n }\n if (item.action) {\n item.action();\n if (onItemSelect) {\n onItemSelect(item.value);\n }\n } else {\n if (onItemSelect) {\n onItemSelect(item.value);\n }\n }\n }}\n end={item.end}\n shortcut={item.shortcut}\n badged={item.badged}\n className={cn(\n sizeStyles[size],\n !item.icon && !item.label\n ? \"hawa-px-0 hawa-py-0 focus:hawa-bg-transparent \"\n : \"focus:hawa-bg-accent \",\n item.presist && \"focus:hawa-bg-transparent\",\n )}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuItem>\n );\n }\n })}\n </DropdownMenuContent>\n </DropdownMenuPortal>\n </DropdownMenuRoot>\n );\n};\ninterface DropdownMenuRadioProps {\n trigger?: React.ReactNode;\n side?: ExtendedDropdownMenuContentProps[\"side\"];\n align?: ExtendedDropdownMenuContentProps[\"align\"];\n options: { label?: any; value: string }[];\n value: string;\n onValueChange: any;\n label?: string;\n}\nconst DropdownMenuRadio: React.FC<DropdownMenuRadioProps> = (props) => {\n return (\n <DropdownMenuRoot>\n <DropdownMenuTrigger asChild>{props.trigger}</DropdownMenuTrigger>\n <DropdownMenuContent align={props.align} side={props.side}>\n {props.label && (\n <>\n <DropdownMenuLabel>{props.label}</DropdownMenuLabel>\n <DropdownMenuSeparator />\n </>\n )}\n <DropdownMenuRadioGroup\n value={props.value}\n onValueChange={props.onValueChange}\n >\n {props.options.map((opt, i) => (\n <DropdownMenuRadioItem key={i} value={opt.value}>\n {opt.label}\n </DropdownMenuRadioItem>\n ))}\n {/* \n <DropdownMenuRadioItem value=\"en\">English</DropdownMenuRadioItem> */}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenuRoot>\n );\n};\n\nexport {\n DropdownMenu,\n DropdownMenuRoot,\n DropdownMenuRadio,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,4BAAuC;;;ACFvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADEA,IAAM,mBAAyC;AAC/C,IAAM,sBAA4C;AAClD,IAAM,oBAA0C;AAChD,IAAM,qBAA2C;AACjD,IAAM,kBAAwC;AAC9C,IAAM,yBAA+C;AAErD,IAAM,yBAA+B,iBAKnC,CAAC,EAAE,WAAW,OAAO,UAAU,GAAG,MAAM,GAAG,QAC3C;AAAA,EAAuB;AAAA,EAAtB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AAAA,EAEJ,oCA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QAAQ,KAAK;AAAA,cACb,WAAW;AAAA,gBACT,WAAW,IAAI;AAAA,gBACf,CAAC,KAAK,QAAQ,CAAC,KAAK,QAChB,mDACA;AAAA,gBACJ,KAAK,WAAW;AAAA,cAClB;AAAA;AAAA,YAEC,KAAK,QAAQ,KAAK;AAAA,YAClB,KAAK,SAAS,KAAK;AAAA,UACtB;AAAA,QAEJ;AAAA,MACF,CAAC;AAAA,IACL,CACF;AAAA,EACF;AAEJ;AAUA,IAAM,oBAAsD,CAAC,UAAU;AACrE,SACE,oCAAC,wBACC,oCAAC,uBAAoB,SAAO,QAAE,MAAM,OAAQ,GAC5C,oCAAC,uBAAoB,OAAO,MAAM,OAAO,MAAM,MAAM,QAClD,MAAM,SACL,0DACE,oCAAC,yBAAmB,MAAM,KAAM,GAChC,oCAAC,2BAAsB,CACzB,GAEF;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,MAAM;AAAA,MACb,eAAe,MAAM;AAAA;AAAA,IAEpB,MAAM,QAAQ,IAAI,CAAC,KAAK,MACvB,oCAAC,yBAAsB,KAAK,GAAG,OAAO,IAAI,SACvC,IAAI,KACP,CACD;AAAA,EAGH,CACF,CACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../elements/dropdownMenu/index.ts","../../elements/dropdownMenu/DropdownMenu.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./DropdownMenu\";\n","import * as React from \"react\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType, RadioOptionType } from \"../../types/commonTypes\";\n\nconst DropdownMenuRoot = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2\">\n {children}\n </div>{\" \"}\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 16 16\"\n height=\"1em\"\n width=\"1em\"\n className={cn(props.dir === \"rtl\" ? \"hawa-rotate-180\" : \"\")}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z\"\n ></path>\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"hawa-z-50 hawa-min-w-[8rem] hawa-gap-1 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg 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));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.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-p-1 hawa-text-popover-foreground hawa-shadow-md 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 </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n end?: any;\n shortcut?: React.ReactNode;\n badged?: boolean;\n slug?: string;\n LinkComponent?: any;\n }\n>(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {\n return (\n <LinkComponent href={slug}>\n <DropdownMenuPrimitive.Item\n disabled={props.disabled}\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n inset && \"hawa-pl-8\",\n props.end &&\n Array.isArray(props.children) &&\n props.children[1] &&\n \"hawa-gap-6\",\n className,\n )}\n {...props}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 \">\n {props.children}\n </div>\n\n {props.end && props.end}\n {!props.end && props.shortcut && (\n <DropdownMenuShortcut>{props.shortcut}</DropdownMenuShortcut>\n )}\n {!props.end && badged && (\n <div className=\"hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500\" />\n )}\n </DropdownMenuPrimitive.Item>\n </LinkComponent>\n );\n});\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n {/* <Check className=\"h-4 w-4\" /> */}\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height=\"0.60em\"\n width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n aria-label=\"Circle\"\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-h-2 hawa-w-2 hawa-fill-current\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"hawa-text-xs hawa-tracking-widest hawa-opacity-60\",\n className,\n )}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\ntype ExtendedDropdownMenuContentProps = Partial<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n> & {\n // Add any additional types or overrides here, for example:\n // side?: \"left\" | \"right\" | \"top\" | \"bottom\"\n};\ntype ExtendedDropdownMenuTriggerProps = Partial<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>\n> & {\n // Add any additional types or overrides here, for example:\n // side?: \"left\" | \"right\" | \"top\" | \"bottom\"\n};\n\nexport type SubItem = {\n label?: string;\n value?: any;\n icon?: any;\n action?: () => void;\n onMiddleClick?: (e: any) => void;\n highlighted?: boolean;\n disabled?: boolean;\n slug?: string;\n};\nexport type MenuItemType = {\n icon?: React.ReactNode;\n label?: string;\n shortcut?: React.ReactNode;\n badged?: boolean;\n value?: any;\n content?: any;\n slug?: string;\n end?: any;\n presist?: boolean;\n itemType?: \"separator\" | \"label\" | \"custom\" | \"radio\";\n action?: () => void;\n highlighted?: boolean;\n subitems?: SubItem[];\n options?: RadioOptionType[];\n currentOption?: string;\n onOptionChange?: (value: string) => void;\n disabled?: boolean;\n onMiddleClick?: (e: any) => void;\n onClick?: any;\n};\ninterface DropdownMenuProps {\n trigger?: any;\n items: MenuItemType[];\n direction?: DirectionType;\n className?: ExtendedDropdownMenuContentProps[\"className\"];\n triggerClassname?: ExtendedDropdownMenuTriggerProps[\"className\"];\n sideOffset?: ExtendedDropdownMenuContentProps[\"sideOffset\"];\n side?: ExtendedDropdownMenuContentProps[\"side\"];\n align?: ExtendedDropdownMenuContentProps[\"align\"];\n alignOffset?: ExtendedDropdownMenuContentProps[\"alignOffset\"];\n width?: \"default\" | \"sm\" | \"lg\" | \"parent\";\n size?: \"default\" | \"sm\";\n onItemSelect?: any;\n onOpenChange?: any;\n header?: React.ReactNode;\n open?: any;\n LinkComponent?: any;\n}\nconst DropdownMenu: React.FC<DropdownMenuProps> = ({\n trigger,\n items,\n direction,\n sideOffset,\n side,\n className,\n triggerClassname,\n align,\n alignOffset,\n onItemSelect,\n size = \"default\",\n width = \"default\",\n header,\n onOpenChange,\n open,\n LinkComponent,\n}) => {\n const widthStyles = {\n default: \"hawa-min-w-[8rem]\",\n sm: \"hawa-w-fit\",\n lg: \"hawa-w-[200px]\",\n parent: \"ddm-w-parent\",\n };\n const sizeStyles = {\n default: \"hawa-px-2 hawa-py-3 \",\n sm: \"hawa-text-xs hawa-px-1.5 hawa-py-1.5 \",\n };\n let [values, setValues] = React.useState(\n items.map((item) => item.currentOption),\n );\n\n return (\n <DropdownMenuRoot\n onOpenChange={onOpenChange}\n open={open}\n modal={false}\n dir={direction}\n >\n <DropdownMenuTrigger asChild className={triggerClassname}>\n {trigger}\n </DropdownMenuTrigger>\n <DropdownMenuPortal>\n <DropdownMenuContent\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n className,\n widthStyles[width],\n \"hawa-flex hawa-flex-col hawa-gap-1 hawa-overflow-y-auto\",\n )}\n style={{\n maxHeight: \"var(--radix-dropdown-menu-content-available-height)\",\n }}\n >\n {header && header}\n {items &&\n items.map((item, index) => {\n const ItemLinkComponent = item.slug ? LinkComponent : \"a\";\n if (item.itemType === \"separator\") {\n return <DropdownMenuSeparator key={index} />;\n } else if (item.itemType === \"label\") {\n return (\n <DropdownMenuLabel key={index}>\n {item.label}\n </DropdownMenuLabel>\n );\n } else if (item.itemType === \"radio\") {\n let dd = item.currentOption;\n return (\n <DropdownMenuSub key={index}>\n <DropdownMenuSubTrigger\n dir={direction}\n className={cn(sizeStyles[size])}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuRadioGroup\n value={values[index]}\n onValueChange={(e) => {\n let newValues = [...values];\n newValues[index] = e;\n setValues(newValues);\n console.log(\"changing to \", e);\n if (item.onOptionChange) {\n item.onOptionChange(e);\n }\n }}\n >\n {item.options?.map((opt, i) => (\n <DropdownMenuRadioItem key={i} value={opt.value}>\n {opt.label}\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n );\n } else if (item.itemType === \"custom\") {\n return <div key={index}>{item.content}</div>;\n } else {\n return item.subitems ? (\n <DropdownMenuSub key={index}>\n <DropdownMenuSubTrigger\n dir={direction}\n className={cn(sizeStyles[size])}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent>\n {item.subitems.map((subitem, subIndex) => {\n const SubitemLinkComponent = subitem.slug\n ? LinkComponent\n : \"a\";\n return (\n <DropdownMenuItem\n key={subIndex}\n LinkComponent={SubitemLinkComponent}\n slug={subitem.slug}\n disabled={subitem.disabled}\n className={cn(\n sizeStyles[size],\n !item.icon && !item.label\n ? \"hawa-px-0 hawa-py-0 focus:hawa-bg-transparent\"\n : \"focus:hawa-bg-accent\",\n )}\n onMouseDown={(event: any) => {\n if (\n event.button === 1 ||\n (event.button === 0 && event.ctrlKey)\n ) {\n event.preventDefault(); // This line prevents the default behavior of the middle button\n if (subitem.onMiddleClick) {\n subitem.onMiddleClick(item.value);\n }\n }\n }}\n onSelect={() => {\n subitem.action && subitem.action();\n if (onItemSelect) {\n onItemSelect(subitem.value);\n }\n }}\n >\n {subitem.icon && subitem.icon}\n {subitem.label && subitem.label}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSub>\n ) : (\n <DropdownMenuItem\n LinkComponent={ItemLinkComponent}\n slug={item.slug}\n key={index}\n disabled={item.disabled}\n onMouseDown={(event: any) => {\n if (\n event.button === 1 ||\n (event.button === 0 && event.ctrlKey)\n ) {\n event.preventDefault(); // This line prevents the default behavior of the middle button\n if (item.onMiddleClick) {\n item.onMiddleClick(item.value);\n }\n }\n }}\n onClick={(event: any) => {\n if (item.onClick) {\n item.onClick(item.value);\n }\n }}\n onSelect={(e) => {\n if (item.presist) {\n e.preventDefault();\n }\n if (item.action) {\n item.action();\n if (onItemSelect) {\n onItemSelect(item.value);\n }\n } else {\n if (onItemSelect) {\n onItemSelect(item.value);\n }\n }\n }}\n end={item.end}\n shortcut={item.shortcut}\n badged={item.badged}\n className={cn(\n sizeStyles[size],\n !item.icon && !item.label\n ? \"hawa-px-0 hawa-py-0 focus:hawa-bg-transparent \"\n : \"focus:hawa-bg-accent \",\n item.presist && \"focus:hawa-bg-transparent\",\n )}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuItem>\n );\n }\n })}\n </DropdownMenuContent>\n </DropdownMenuPortal>\n </DropdownMenuRoot>\n );\n};\ninterface DropdownMenuRadioProps {\n trigger?: React.ReactNode;\n side?: ExtendedDropdownMenuContentProps[\"side\"];\n align?: ExtendedDropdownMenuContentProps[\"align\"];\n options: RadioOptionType[];\n value: string;\n onValueChange: any;\n label?: string;\n}\nconst DropdownMenuRadio: React.FC<DropdownMenuRadioProps> = (props) => {\n return (\n <DropdownMenuRoot>\n <DropdownMenuTrigger asChild>{props.trigger}</DropdownMenuTrigger>\n <DropdownMenuContent align={props.align} side={props.side}>\n {props.label && (\n <>\n <DropdownMenuLabel>{props.label}</DropdownMenuLabel>\n <DropdownMenuSeparator />\n </>\n )}\n <DropdownMenuRadioGroup\n value={props.value}\n onValueChange={props.onValueChange}\n >\n {props.options.map((opt, i) => (\n <DropdownMenuRadioItem key={i} value={opt.value}>\n {opt.label}\n </DropdownMenuRadioItem>\n ))}\n {/* \n <DropdownMenuRadioItem value=\"en\">English</DropdownMenuRadioItem> */}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenuRoot>\n );\n};\n\nexport {\n DropdownMenu,\n DropdownMenuRoot,\n DropdownMenuRadio,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,4BAAuC;;;ACFvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MA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,WAAW;AAAA,gBACT,WAAW,IAAI;AAAA,gBACf,CAAC,KAAK,QAAQ,CAAC,KAAK,QAChB,mDACA;AAAA,gBACJ,KAAK,WAAW;AAAA,cAClB;AAAA;AAAA,YAEC,KAAK,QAAQ,KAAK;AAAA,YAClB,KAAK,SAAS,KAAK;AAAA,UACtB;AAAA,QAEJ;AAAA,MACF,CAAC;AAAA,IACL,CACF;AAAA,EACF;AAEJ;AAUA,IAAM,oBAAsD,CAAC,UAAU;AACrE,SACE,oCAAC,wBACC,oCAAC,uBAAoB,SAAO,QAAE,MAAM,OAAQ,GAC5C,oCAAC,uBAAoB,OAAO,MAAM,OAAO,MAAM,MAAM,QAClD,MAAM,SACL,0DACE,oCAAC,yBAAmB,MAAM,KAAM,GAChC,oCAAC,2BAAsB,CACzB,GAEF;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,MAAM;AAAA,MACb,eAAe,MAAM;AAAA;AAAA,IAEpB,MAAM,QAAQ,IAAI,CAAC,KAAK,MACvB,oCAAC,yBAAsB,KAAK,GAAG,OAAO,IAAI,SACvC,IAAI,KACP,CACD;AAAA,EAGH,CACF,CACF;AAEJ;","names":[]}
@@ -222,6 +222,9 @@ var DropdownMenu = ({
222
222
  default: "hawa-px-2 hawa-py-3 ",
223
223
  sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
224
224
  };
225
+ let [values, setValues] = React.useState(
226
+ items.map((item) => item.currentOption)
227
+ );
225
228
  return /* @__PURE__ */ React.createElement(
226
229
  DropdownMenuRoot,
227
230
  {
@@ -249,11 +252,38 @@ var DropdownMenu = ({
249
252
  },
250
253
  header && header,
251
254
  items && items.map((item, index) => {
255
+ var _a;
252
256
  const ItemLinkComponent = item.slug ? LinkComponent : "a";
253
257
  if (item.itemType === "separator") {
254
258
  return /* @__PURE__ */ React.createElement(DropdownMenuSeparator, { key: index });
255
259
  } else if (item.itemType === "label") {
256
260
  return /* @__PURE__ */ React.createElement(DropdownMenuLabel, { key: index }, item.label);
261
+ } else if (item.itemType === "radio") {
262
+ let dd = item.currentOption;
263
+ return /* @__PURE__ */ React.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React.createElement(
264
+ DropdownMenuSubTrigger,
265
+ {
266
+ dir: direction,
267
+ className: cn(sizeStyles[size])
268
+ },
269
+ item.icon && item.icon,
270
+ item.label && item.label
271
+ ), /* @__PURE__ */ React.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React.createElement(
272
+ DropdownMenuRadioGroup,
273
+ {
274
+ value: values[index],
275
+ onValueChange: (e) => {
276
+ let newValues = [...values];
277
+ newValues[index] = e;
278
+ setValues(newValues);
279
+ console.log("changing to ", e);
280
+ if (item.onOptionChange) {
281
+ item.onOptionChange(e);
282
+ }
283
+ }
284
+ },
285
+ (_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
286
+ )));
257
287
  } else if (item.itemType === "custom") {
258
288
  return /* @__PURE__ */ React.createElement("div", { key: index }, item.content);
259
289
  } else {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/dropdownMenu/DropdownMenu.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"../../types/commonTypes\";\n\nconst DropdownMenuRoot = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2\">\n {children}\n </div>{\" \"}\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 16 16\"\n height=\"1em\"\n width=\"1em\"\n className={cn(props.dir === \"rtl\" ? \"hawa-rotate-180\" : \"\")}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z\"\n ></path>\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"hawa-z-50 hawa-min-w-[8rem] hawa-gap-1 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg 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));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.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-p-1 hawa-text-popover-foreground hawa-shadow-md 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 </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n end?: any;\n shortcut?: React.ReactNode;\n badged?: boolean;\n slug?: string;\n LinkComponent?: any;\n }\n>(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {\n return (\n <LinkComponent href={slug}>\n <DropdownMenuPrimitive.Item\n disabled={props.disabled}\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n inset && \"hawa-pl-8\",\n props.end &&\n Array.isArray(props.children) &&\n props.children[1] &&\n \"hawa-gap-6\",\n className,\n )}\n {...props}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 \">\n {props.children}\n </div>\n\n {props.end && props.end}\n {!props.end && props.shortcut && (\n <DropdownMenuShortcut>{props.shortcut}</DropdownMenuShortcut>\n )}\n {!props.end && badged && (\n <div className=\"hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500\" />\n )}\n </DropdownMenuPrimitive.Item>\n </LinkComponent>\n );\n});\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n {/* <Check className=\"h-4 w-4\" /> */}\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height=\"0.60em\"\n width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n aria-label=\"Circle\"\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-h-2 hawa-w-2 hawa-fill-current\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"hawa-text-xs hawa-tracking-widest hawa-opacity-60\",\n className,\n )}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\ntype ExtendedDropdownMenuContentProps = Partial<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n> & {\n // Add any additional types or overrides here, for example:\n // side?: \"left\" | \"right\" | \"top\" | \"bottom\"\n};\ntype ExtendedDropdownMenuTriggerProps = Partial<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>\n> & {\n // Add any additional types or overrides here, for example:\n // side?: \"left\" | \"right\" | \"top\" | \"bottom\"\n};\n\nexport type SubItem = {\n label?: string;\n value?: any;\n icon?: any;\n action?: () => void;\n onMiddleClick?: (e: any) => void;\n highlighted?: boolean;\n disabled?: boolean;\n slug?: string;\n};\nexport type MenuItemType = {\n icon?: React.ReactNode;\n label?: string;\n shortcut?: React.ReactNode;\n badged?: boolean;\n value?: any;\n content?: any;\n slug?: string;\n end?: any;\n presist?: boolean;\n itemType?: \"separator\" | \"label\" | \"custom\";\n action?: () => void;\n highlighted?: boolean;\n subitems?: SubItem[];\n disabled?: boolean;\n onMiddleClick?: (e: any) => void;\n onClick?: any;\n};\ninterface DropdownMenuProps {\n trigger?: any;\n items: MenuItemType[];\n direction?: DirectionType;\n className?: ExtendedDropdownMenuContentProps[\"className\"];\n triggerClassname?: ExtendedDropdownMenuTriggerProps[\"className\"];\n sideOffset?: ExtendedDropdownMenuContentProps[\"sideOffset\"];\n side?: ExtendedDropdownMenuContentProps[\"side\"];\n align?: ExtendedDropdownMenuContentProps[\"align\"];\n alignOffset?: ExtendedDropdownMenuContentProps[\"alignOffset\"];\n width?: \"default\" | \"sm\" | \"lg\" | \"parent\";\n size?: \"default\" | \"sm\";\n onItemSelect?: any;\n onOpenChange?: any;\n header?: React.ReactNode;\n open?: any;\n LinkComponent?: any;\n}\nconst DropdownMenu: React.FC<DropdownMenuProps> = ({\n trigger,\n items,\n direction,\n sideOffset,\n side,\n className,\n triggerClassname,\n align,\n alignOffset,\n onItemSelect,\n size = \"default\",\n width = \"default\",\n header,\n onOpenChange,\n open,\n LinkComponent,\n}) => {\n const widthStyles = {\n default: \"hawa-min-w-[8rem]\",\n sm: \"hawa-w-fit\",\n lg: \"hawa-w-[200px]\",\n parent: \"ddm-w-parent\",\n };\n const sizeStyles = {\n default: \"hawa-px-2 hawa-py-3 \",\n sm: \"hawa-text-xs hawa-px-1.5 hawa-py-1.5 \",\n };\n\n return (\n <DropdownMenuRoot\n onOpenChange={onOpenChange}\n open={open}\n modal={false}\n dir={direction}\n >\n <DropdownMenuTrigger asChild className={triggerClassname}>\n {trigger}\n </DropdownMenuTrigger>\n <DropdownMenuPortal>\n <DropdownMenuContent\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n className,\n widthStyles[width],\n \"hawa-flex hawa-flex-col hawa-gap-1 hawa-overflow-y-auto\",\n )}\n style={{\n maxHeight: \"var(--radix-dropdown-menu-content-available-height)\",\n }}\n >\n {header && header}\n {items &&\n items.map((item, index) => {\n const ItemLinkComponent = item.slug ? LinkComponent : \"a\";\n if (item.itemType === \"separator\") {\n return <DropdownMenuSeparator key={index} />;\n } else if (item.itemType === \"label\") {\n return (\n <DropdownMenuLabel key={index}>\n {item.label}\n </DropdownMenuLabel>\n );\n } else if (item.itemType === \"custom\") {\n return <div key={index}>{item.content}</div>;\n } else {\n return item.subitems ? (\n <DropdownMenuSub key={index}>\n <DropdownMenuSubTrigger\n dir={direction}\n className={cn(sizeStyles[size])}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent>\n {item.subitems.map((subitem, subIndex) => {\n const SubitemLinkComponent = subitem.slug\n ? LinkComponent\n : \"a\";\n return (\n <DropdownMenuItem\n key={subIndex}\n LinkComponent={SubitemLinkComponent}\n slug={subitem.slug}\n disabled={subitem.disabled}\n className={cn(\n sizeStyles[size],\n !item.icon && !item.label\n ? \"hawa-px-0 hawa-py-0 focus:hawa-bg-transparent\"\n : \"focus:hawa-bg-accent\",\n )}\n onMouseDown={(event: any) => {\n if (\n event.button === 1 ||\n (event.button === 0 && event.ctrlKey)\n ) {\n event.preventDefault(); // This line prevents the default behavior of the middle button\n if (subitem.onMiddleClick) {\n subitem.onMiddleClick(item.value);\n }\n }\n }}\n onSelect={() => {\n subitem.action && subitem.action();\n if (onItemSelect) {\n onItemSelect(subitem.value);\n }\n }}\n >\n {subitem.icon && subitem.icon}\n {subitem.label && subitem.label}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSub>\n ) : (\n <DropdownMenuItem\n LinkComponent={ItemLinkComponent}\n slug={item.slug}\n key={index}\n disabled={item.disabled}\n onMouseDown={(event: any) => {\n if (\n event.button === 1 ||\n (event.button === 0 && event.ctrlKey)\n ) {\n event.preventDefault(); // This line prevents the default behavior of the middle button\n if (item.onMiddleClick) {\n item.onMiddleClick(item.value);\n }\n }\n }}\n onClick={(event: any) => {\n if (item.onClick) {\n item.onClick(item.value);\n }\n }}\n onSelect={(e) => {\n if (item.presist) {\n e.preventDefault();\n }\n if (item.action) {\n item.action();\n if (onItemSelect) {\n onItemSelect(item.value);\n }\n } else {\n if (onItemSelect) {\n onItemSelect(item.value);\n }\n }\n }}\n end={item.end}\n shortcut={item.shortcut}\n badged={item.badged}\n className={cn(\n sizeStyles[size],\n !item.icon && !item.label\n ? \"hawa-px-0 hawa-py-0 focus:hawa-bg-transparent \"\n : \"focus:hawa-bg-accent \",\n item.presist && \"focus:hawa-bg-transparent\",\n )}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuItem>\n );\n }\n })}\n </DropdownMenuContent>\n </DropdownMenuPortal>\n </DropdownMenuRoot>\n );\n};\ninterface DropdownMenuRadioProps {\n trigger?: React.ReactNode;\n side?: ExtendedDropdownMenuContentProps[\"side\"];\n align?: ExtendedDropdownMenuContentProps[\"align\"];\n options: { label?: any; value: string }[];\n value: string;\n onValueChange: any;\n label?: string;\n}\nconst DropdownMenuRadio: React.FC<DropdownMenuRadioProps> = (props) => {\n return (\n <DropdownMenuRoot>\n <DropdownMenuTrigger asChild>{props.trigger}</DropdownMenuTrigger>\n <DropdownMenuContent align={props.align} side={props.side}>\n {props.label && (\n <>\n <DropdownMenuLabel>{props.label}</DropdownMenuLabel>\n <DropdownMenuSeparator />\n </>\n )}\n <DropdownMenuRadioGroup\n value={props.value}\n onValueChange={props.onValueChange}\n >\n {props.options.map((opt, i) => (\n <DropdownMenuRadioItem key={i} value={opt.value}>\n {opt.label}\n </DropdownMenuRadioItem>\n ))}\n {/* \n <DropdownMenuRadioItem value=\"en\">English</DropdownMenuRadioItem> */}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenuRoot>\n );\n};\n\nexport {\n DropdownMenu,\n DropdownMenuRoot,\n DropdownMenuRadio,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\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"],"mappings":";;;AAAA,YAAY,WAAW;AAEvB,YAAY,2BAA2B;;;ACFvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADEA,IAAM,mBAAyC;AAC/C,IAAM,sBAA4C;AAClD,IAAM,oBAA0C;AAChD,IAAM,qBAA2C;AACjD,IAAM,kBAAwC;AAC9C,IAAM,yBAA+C;AAErD,IAAM,yBAA+B,iBAKnC,CAAC,EAAE,WAAW,OAAO,UAAU,GAAG,MAAM,GAAG,QAC3C;AAAA,EAAuB;AAAA,EAAtB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AAAA,EAEJ,oCAAC,SAAI,WAAU,0DACZ,QACH;AAAA,EAAO;AAAA,EACP;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,QAAO;AAAA,MACP,MAAK;AAAA,MACL,aAAY;AAAA,MACZ,SAAQ;AAAA,MACR,QAAO;AAAA,MACP,OAAM;AAAA,MACN,WAAW,GAAG,MAAM,QAAQ,QAAQ,oBAAoB,EAAE;AAAA;AAAA,IAE1D;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,GAAE;AAAA;AAAA,IACH;AAAA,EACH;AACF,CACD;AACD,uBAAuB,cACC,iCAAW;AAEnC,IAAM,yBAA+B,iBAGnC,CAAC,EAAE,WAAW,GA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AM,MAAM,QAClD,MAAM,SACL,0DACE,oCAAC,yBAAmB,MAAM,KAAM,GAChC,oCAAC,2BAAsB,CACzB,GAEF;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,MAAM;AAAA,MACb,eAAe,MAAM;AAAA;AAAA,IAEpB,MAAM,QAAQ,IAAI,CAAC,KAAK,MACvB,oCAAC,yBAAsB,KAAK,GAAG,OAAO,IAAI,SACvC,IAAI,KACP,CACD;AAAA,EAGH,CACF,CACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../elements/dropdownMenu/DropdownMenu.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType, RadioOptionType } from \"../../types/commonTypes\";\n\nconst DropdownMenuRoot = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2\">\n {children}\n </div>{\" \"}\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 16 16\"\n height=\"1em\"\n width=\"1em\"\n className={cn(props.dir === \"rtl\" ? \"hawa-rotate-180\" : \"\")}\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z\"\n ></path>\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"hawa-z-50 hawa-min-w-[8rem] hawa-gap-1 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg 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));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.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-p-1 hawa-text-popover-foreground hawa-shadow-md 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 </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n end?: any;\n shortcut?: React.ReactNode;\n badged?: boolean;\n slug?: string;\n LinkComponent?: any;\n }\n>(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {\n return (\n <LinkComponent href={slug}>\n <DropdownMenuPrimitive.Item\n disabled={props.disabled}\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n inset && \"hawa-pl-8\",\n props.end &&\n Array.isArray(props.children) &&\n props.children[1] &&\n \"hawa-gap-6\",\n className,\n )}\n {...props}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 \">\n {props.children}\n </div>\n\n {props.end && props.end}\n {!props.end && props.shortcut && (\n <DropdownMenuShortcut>{props.shortcut}</DropdownMenuShortcut>\n )}\n {!props.end && badged && (\n <div className=\"hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500\" />\n )}\n </DropdownMenuPrimitive.Item>\n </LinkComponent>\n );\n});\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n {/* <Check className=\"h-4 w-4\" /> */}\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height=\"0.60em\"\n width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n aria-label=\"Circle\"\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-h-2 hawa-w-2 hawa-fill-current\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold\",\n inset && \"hawa-pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"hawa-text-xs hawa-tracking-widest hawa-opacity-60\",\n className,\n )}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\ntype ExtendedDropdownMenuContentProps = Partial<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n> & {\n // Add any additional types or overrides here, for example:\n // side?: \"left\" | \"right\" | \"top\" | \"bottom\"\n};\ntype ExtendedDropdownMenuTriggerProps = Partial<\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>\n> & {\n // Add any additional types or overrides here, for example:\n // side?: \"left\" | \"right\" | \"top\" | \"bottom\"\n};\n\nexport type SubItem = {\n label?: string;\n value?: any;\n icon?: any;\n action?: () => void;\n onMiddleClick?: (e: any) => void;\n highlighted?: boolean;\n disabled?: boolean;\n slug?: string;\n};\nexport type MenuItemType = {\n icon?: React.ReactNode;\n label?: string;\n shortcut?: React.ReactNode;\n badged?: boolean;\n value?: any;\n content?: any;\n slug?: string;\n end?: any;\n presist?: boolean;\n itemType?: \"separator\" | \"label\" | \"custom\" | \"radio\";\n action?: () => void;\n highlighted?: boolean;\n subitems?: SubItem[];\n options?: RadioOptionType[];\n currentOption?: string;\n onOptionChange?: (value: string) => void;\n disabled?: boolean;\n onMiddleClick?: (e: any) => void;\n onClick?: any;\n};\ninterface DropdownMenuProps {\n trigger?: any;\n items: MenuItemType[];\n direction?: DirectionType;\n className?: ExtendedDropdownMenuContentProps[\"className\"];\n triggerClassname?: ExtendedDropdownMenuTriggerProps[\"className\"];\n sideOffset?: ExtendedDropdownMenuContentProps[\"sideOffset\"];\n side?: ExtendedDropdownMenuContentProps[\"side\"];\n align?: ExtendedDropdownMenuContentProps[\"align\"];\n alignOffset?: ExtendedDropdownMenuContentProps[\"alignOffset\"];\n width?: \"default\" | \"sm\" | \"lg\" | \"parent\";\n size?: \"default\" | \"sm\";\n onItemSelect?: any;\n onOpenChange?: any;\n header?: React.ReactNode;\n open?: any;\n LinkComponent?: any;\n}\nconst DropdownMenu: React.FC<DropdownMenuProps> = ({\n trigger,\n items,\n direction,\n sideOffset,\n side,\n className,\n triggerClassname,\n align,\n alignOffset,\n onItemSelect,\n size = \"default\",\n width = \"default\",\n header,\n onOpenChange,\n open,\n LinkComponent,\n}) => {\n const widthStyles = {\n default: \"hawa-min-w-[8rem]\",\n sm: \"hawa-w-fit\",\n lg: \"hawa-w-[200px]\",\n parent: \"ddm-w-parent\",\n };\n const sizeStyles = {\n default: \"hawa-px-2 hawa-py-3 \",\n sm: \"hawa-text-xs hawa-px-1.5 hawa-py-1.5 \",\n };\n let [values, setValues] = React.useState(\n items.map((item) => item.currentOption),\n );\n\n return (\n <DropdownMenuRoot\n onOpenChange={onOpenChange}\n open={open}\n modal={false}\n dir={direction}\n >\n <DropdownMenuTrigger asChild className={triggerClassname}>\n {trigger}\n </DropdownMenuTrigger>\n <DropdownMenuPortal>\n <DropdownMenuContent\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n className,\n widthStyles[width],\n \"hawa-flex hawa-flex-col hawa-gap-1 hawa-overflow-y-auto\",\n )}\n style={{\n maxHeight: \"var(--radix-dropdown-menu-content-available-height)\",\n }}\n >\n {header && header}\n {items &&\n items.map((item, index) => {\n const ItemLinkComponent = item.slug ? LinkComponent : \"a\";\n if (item.itemType === \"separator\") {\n return <DropdownMenuSeparator key={index} />;\n } else if (item.itemType === \"label\") {\n return (\n <DropdownMenuLabel key={index}>\n {item.label}\n </DropdownMenuLabel>\n );\n } else if (item.itemType === \"radio\") {\n let dd = item.currentOption;\n return (\n <DropdownMenuSub key={index}>\n <DropdownMenuSubTrigger\n dir={direction}\n className={cn(sizeStyles[size])}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <DropdownMenuRadioGroup\n value={values[index]}\n onValueChange={(e) => {\n let newValues = [...values];\n newValues[index] = e;\n setValues(newValues);\n console.log(\"changing to \", e);\n if (item.onOptionChange) {\n item.onOptionChange(e);\n }\n }}\n >\n {item.options?.map((opt, i) => (\n <DropdownMenuRadioItem key={i} value={opt.value}>\n {opt.label}\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n );\n } else if (item.itemType === \"custom\") {\n return <div key={index}>{item.content}</div>;\n } else {\n return item.subitems ? (\n <DropdownMenuSub key={index}>\n <DropdownMenuSubTrigger\n dir={direction}\n className={cn(sizeStyles[size])}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent>\n {item.subitems.map((subitem, subIndex) => {\n const SubitemLinkComponent = subitem.slug\n ? LinkComponent\n : \"a\";\n return (\n <DropdownMenuItem\n key={subIndex}\n LinkComponent={SubitemLinkComponent}\n slug={subitem.slug}\n disabled={subitem.disabled}\n className={cn(\n sizeStyles[size],\n !item.icon && !item.label\n ? \"hawa-px-0 hawa-py-0 focus:hawa-bg-transparent\"\n : \"focus:hawa-bg-accent\",\n )}\n onMouseDown={(event: any) => {\n if (\n event.button === 1 ||\n (event.button === 0 && event.ctrlKey)\n ) {\n event.preventDefault(); // This line prevents the default behavior of the middle button\n if (subitem.onMiddleClick) {\n subitem.onMiddleClick(item.value);\n }\n }\n }}\n onSelect={() => {\n subitem.action && subitem.action();\n if (onItemSelect) {\n onItemSelect(subitem.value);\n }\n }}\n >\n {subitem.icon && subitem.icon}\n {subitem.label && subitem.label}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSub>\n ) : (\n <DropdownMenuItem\n LinkComponent={ItemLinkComponent}\n slug={item.slug}\n key={index}\n disabled={item.disabled}\n onMouseDown={(event: any) => {\n if (\n event.button === 1 ||\n (event.button === 0 && event.ctrlKey)\n ) {\n event.preventDefault(); // This line prevents the default behavior of the middle button\n if (item.onMiddleClick) {\n item.onMiddleClick(item.value);\n }\n }\n }}\n onClick={(event: any) => {\n if (item.onClick) {\n item.onClick(item.value);\n }\n }}\n onSelect={(e) => {\n if (item.presist) {\n e.preventDefault();\n }\n if (item.action) {\n item.action();\n if (onItemSelect) {\n onItemSelect(item.value);\n }\n } else {\n if (onItemSelect) {\n onItemSelect(item.value);\n }\n }\n }}\n end={item.end}\n shortcut={item.shortcut}\n badged={item.badged}\n className={cn(\n sizeStyles[size],\n !item.icon && !item.label\n ? \"hawa-px-0 hawa-py-0 focus:hawa-bg-transparent \"\n : \"focus:hawa-bg-accent \",\n item.presist && \"focus:hawa-bg-transparent\",\n )}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuItem>\n );\n }\n })}\n </DropdownMenuContent>\n </DropdownMenuPortal>\n </DropdownMenuRoot>\n );\n};\ninterface DropdownMenuRadioProps {\n trigger?: React.ReactNode;\n side?: ExtendedDropdownMenuContentProps[\"side\"];\n align?: ExtendedDropdownMenuContentProps[\"align\"];\n options: RadioOptionType[];\n value: string;\n onValueChange: any;\n label?: string;\n}\nconst DropdownMenuRadio: React.FC<DropdownMenuRadioProps> = (props) => {\n return (\n <DropdownMenuRoot>\n <DropdownMenuTrigger asChild>{props.trigger}</DropdownMenuTrigger>\n <DropdownMenuContent align={props.align} side={props.side}>\n {props.label && (\n <>\n <DropdownMenuLabel>{props.label}</DropdownMenuLabel>\n <DropdownMenuSeparator />\n </>\n )}\n <DropdownMenuRadioGroup\n value={props.value}\n onValueChange={props.onValueChange}\n >\n {props.options.map((opt, i) => (\n <DropdownMenuRadioItem key={i} value={opt.value}>\n {opt.label}\n </DropdownMenuRadioItem>\n ))}\n {/* \n <DropdownMenuRadioItem value=\"en\">English</DropdownMenuRadioItem> */}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenuRoot>\n );\n};\n\nexport {\n DropdownMenu,\n DropdownMenuRoot,\n DropdownMenuRadio,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\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"],"mappings":";;;AAAA,YAAY,WAAW;AAEvB,YAAY,2BAA2B;;;ACFvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADEA,IAAM,mBAAyC;AAC/C,IAAM,sBAA4C;AAClD,IAAM,oBAA0C;AAChD,IAAM,qBAA2C;AACjD,IAAM,kBAAwC;AAC9C,IAAM,yBAA+C;AAErD,IAAM,yBAA+B,iBAKnC,CAAC,EAAE,WAAW,OAAO,UAAU,GAAG,MAAM,GAAG,QAC3C;AAAA,EAAuB;AAAA,EAAtB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AAAA,EAEJ,oCAAC,SAAI,WAAU,0DACZ,QACH;AAAA,EAAO;AAAA,EACP;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,QAAO;AAAA,MACP,MAAK;AAAA,MACL,aAAY;AAAA,MACZ,SAAQ;AAAA,MACR,QAAO;AAAA,MACP,OAAM;AAAA,MACN,WAAW,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B,oCAAC,yBAAsB,KAAK,GAAG,OAAO,IAAI,SACvC,IAAI,KACP,CACD;AAAA,EAGH,CACF,CACF;AAEJ;","names":[]}
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import React__default, { FC, RefObject, ReactNode, ChangeEvent, InputHTMLAttributes } from 'react';
3
3
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
4
4
  import { P as PositionType, D as DirectionType, S as SeverityType, R as RadiusType, O as OrientationType } from '../commonTypes-CKtkuNFH.mjs';
5
- export { D as DropdownMenu, f as DropdownMenuCheckboxItem, d as DropdownMenuContent, k as DropdownMenuGroup, e as DropdownMenuItem, h as DropdownMenuLabel, l as DropdownMenuPortal, b as DropdownMenuRadio, p as DropdownMenuRadioGroup, g as DropdownMenuRadioItem, a as DropdownMenuRoot, i as DropdownMenuSeparator, j as DropdownMenuShortcut, m as DropdownMenuSub, n as DropdownMenuSubContent, o as DropdownMenuSubTrigger, c as DropdownMenuTrigger, M as MenuItemType, S as SubItem } from '../DropdownMenu-arqV1gRt.mjs';
5
+ export { D as DropdownMenu, f as DropdownMenuCheckboxItem, d as DropdownMenuContent, k as DropdownMenuGroup, e as DropdownMenuItem, h as DropdownMenuLabel, l as DropdownMenuPortal, b as DropdownMenuRadio, p as DropdownMenuRadioGroup, g as DropdownMenuRadioItem, a as DropdownMenuRoot, i as DropdownMenuSeparator, j as DropdownMenuShortcut, m as DropdownMenuSub, n as DropdownMenuSubContent, o as DropdownMenuSubTrigger, c as DropdownMenuTrigger, M as MenuItemType, S as SubItem } from '../DropdownMenu-o_-MnT5h.mjs';
6
6
  import { a as ChipTypes } from '../Chip-hr2gRBJ-.mjs';
7
7
  export { b as Chip, C as ChipColors } from '../Chip-hr2gRBJ-.mjs';
8
8
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
@@ -616,14 +616,16 @@ declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressPrimitive.P
616
616
  labelProps?: LabelProps | undefined;
617
617
  } & React.RefAttributes<HTMLDivElement>>;
618
618
 
619
+ type BreadcrumbItemProps = {
620
+ label: string;
621
+ href: string;
622
+ };
619
623
  interface BCTypes {
620
624
  /** The array of crumbs, each one with a label and a href link */
621
- breadcrumbLinks: {
622
- label: string;
623
- href: string;
624
- }[];
625
+ breadcrumbLinks: BreadcrumbItemProps[];
625
626
  /** The separator between each crumb, can be character or React Node. The default is ">" */
626
627
  separator?: string | ReactNode;
628
+ size?: "normal" | "small" | "xs";
627
629
  }
628
630
  declare const Breadcrumb: FC<BCTypes>;
629
631
 
@@ -879,4 +881,4 @@ type PhoneMockupProps = {
879
881
  };
880
882
  declare const PhoneMockup: React__default.FC<PhoneMockupProps>;
881
883
 
882
- export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
884
+ export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import React__default, { FC, RefObject, ReactNode, ChangeEvent, InputHTMLAttributes } from 'react';
3
3
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
4
4
  import { P as PositionType, D as DirectionType, S as SeverityType, R as RadiusType, O as OrientationType } from '../commonTypes-CKtkuNFH.js';
5
- export { D as DropdownMenu, f as DropdownMenuCheckboxItem, d as DropdownMenuContent, k as DropdownMenuGroup, e as DropdownMenuItem, h as DropdownMenuLabel, l as DropdownMenuPortal, b as DropdownMenuRadio, p as DropdownMenuRadioGroup, g as DropdownMenuRadioItem, a as DropdownMenuRoot, i as DropdownMenuSeparator, j as DropdownMenuShortcut, m as DropdownMenuSub, n as DropdownMenuSubContent, o as DropdownMenuSubTrigger, c as DropdownMenuTrigger, M as MenuItemType, S as SubItem } from '../DropdownMenu-sSnQc6fT.js';
5
+ export { D as DropdownMenu, f as DropdownMenuCheckboxItem, d as DropdownMenuContent, k as DropdownMenuGroup, e as DropdownMenuItem, h as DropdownMenuLabel, l as DropdownMenuPortal, b as DropdownMenuRadio, p as DropdownMenuRadioGroup, g as DropdownMenuRadioItem, a as DropdownMenuRoot, i as DropdownMenuSeparator, j as DropdownMenuShortcut, m as DropdownMenuSub, n as DropdownMenuSubContent, o as DropdownMenuSubTrigger, c as DropdownMenuTrigger, M as MenuItemType, S as SubItem } from '../DropdownMenu-p-Ha-y2R.js';
6
6
  import { a as ChipTypes } from '../Chip-H5BnuDdx.js';
7
7
  export { b as Chip, C as ChipColors } from '../Chip-H5BnuDdx.js';
8
8
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
@@ -616,14 +616,16 @@ declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressPrimitive.P
616
616
  labelProps?: LabelProps | undefined;
617
617
  } & React.RefAttributes<HTMLDivElement>>;
618
618
 
619
+ type BreadcrumbItemProps = {
620
+ label: string;
621
+ href: string;
622
+ };
619
623
  interface BCTypes {
620
624
  /** The array of crumbs, each one with a label and a href link */
621
- breadcrumbLinks: {
622
- label: string;
623
- href: string;
624
- }[];
625
+ breadcrumbLinks: BreadcrumbItemProps[];
625
626
  /** The separator between each crumb, can be character or React Node. The default is ">" */
626
627
  separator?: string | ReactNode;
628
+ size?: "normal" | "small" | "xs";
627
629
  }
628
630
  declare const Breadcrumb: FC<BCTypes>;
629
631
 
@@ -879,4 +881,4 @@ type PhoneMockupProps = {
879
881
  };
880
882
  declare const PhoneMockup: React__default.FC<PhoneMockupProps>;
881
883
 
882
- export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
884
+ export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };