@sikka/hawa 0.38.3-next → 0.38.4-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DropdownMenu-vd38nhPj.d.ts → DropdownMenu-Cxlm5lZl.d.ts} +1 -2
- package/dist/{DropdownMenu-Cgb6bKEn.d.mts → DropdownMenu-Dly5lsqz.d.mts} +1 -2
- package/dist/appLayout/index.js +1 -1
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +1 -1
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appTopbar/index.js +1 -1
- package/dist/appTopbar/index.js.map +1 -1
- package/dist/appTopbar/index.mjs +1 -1
- package/dist/appTopbar/index.mjs.map +1 -1
- package/dist/blocks/index.d.mts +1 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/index.js +1 -1
- package/dist/blocks/index.mjs +2 -2
- package/dist/blocks/pricing/index.js +1 -1
- package/dist/blocks/pricing/index.mjs +1 -1
- package/dist/{chunk-XPHEFAOH.mjs → chunk-GVPIM5KC.mjs} +2 -3
- package/dist/{chunk-2POUSHCT.mjs → chunk-GZVEFVSJ.mjs} +1 -1
- package/dist/{chunk-275MR7RO.mjs → chunk-RZJPAN5T.mjs} +1 -1
- package/dist/dataTable/index.js +1 -1
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +1 -1
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/dropdownMenu/index.d.mts +2 -2
- package/dist/dropdownMenu/index.d.ts +2 -2
- package/dist/dropdownMenu/index.js +2 -3
- package/dist/dropdownMenu/index.js.map +1 -1
- package/dist/dropdownMenu/index.mjs +2 -3
- package/dist/dropdownMenu/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +2 -1
- package/dist/elements/index.d.ts +2 -1
- package/dist/elements/index.js +2 -3
- package/dist/elements/index.mjs +5 -5
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -3
- package/dist/index.mjs +2 -3
- package/dist/layout/index.d.mts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/index.mjs +2 -2
- package/dist/splitButton/index.js +1 -1
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +1 -1
- package/dist/splitButton/index.mjs.map +1 -1
- package/package.json +1 -1
@@ -1,11 +1,11 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
3
3
|
import { R as RadioOptionType, D as DirectionType } from '../commonTypes-TGqbHlp_.js';
|
4
|
+
export { Portal as DropdownMenuPortal } from '@headlessui/react';
|
4
5
|
|
5
6
|
declare const DropdownMenuRoot: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
6
7
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
7
8
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
8
|
-
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
9
9
|
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
10
10
|
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
11
11
|
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
@@ -100,4 +100,4 @@ interface DropdownMenuRadioProps {
|
|
100
100
|
}
|
101
101
|
declare const DropdownMenuRadio: React.FC<DropdownMenuRadioProps>;
|
102
102
|
|
103
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel,
|
103
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadio, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type MenuItemType, type SubItem };
|
@@ -37,7 +37,7 @@ __export(dropdownMenu_exports, {
|
|
37
37
|
DropdownMenuGroup: () => DropdownMenuGroup,
|
38
38
|
DropdownMenuItem: () => DropdownMenuItem,
|
39
39
|
DropdownMenuLabel: () => DropdownMenuLabel,
|
40
|
-
DropdownMenuPortal: () =>
|
40
|
+
DropdownMenuPortal: () => import_react.Portal,
|
41
41
|
DropdownMenuRadio: () => DropdownMenuRadio,
|
42
42
|
DropdownMenuRadioGroup: () => DropdownMenuRadioGroup,
|
43
43
|
DropdownMenuRadioItem: () => DropdownMenuRadioItem,
|
@@ -67,7 +67,6 @@ function cn(...inputs) {
|
|
67
67
|
var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
68
68
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
69
69
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
70
|
-
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
71
70
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
72
71
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
73
72
|
var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
@@ -130,7 +129,7 @@ var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...prop
|
|
130
129
|
}
|
131
130
|
)));
|
132
131
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
133
|
-
var DropdownMenuItem = React.forwardRef(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {
|
132
|
+
var DropdownMenuItem = React.forwardRef(({ className, inset, badged, slug, LinkComponent = "a", ...props }, ref) => {
|
134
133
|
return /* @__PURE__ */ React.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React.createElement(
|
135
134
|
DropdownMenuPrimitive.Item,
|
136
135
|
{
|
@@ -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 { Portal } from \"@headlessui/react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType, RadioOptionType } from \"../../types/commonTypes\";\n\n// New import\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 <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 </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 classNames?: {\n trigger?: string;\n content?: string;\n item?: string;\n };\n className?: ExtendedDropdownMenuContentProps[\"className\"];\n triggerClassname?: ExtendedDropdownMenuTriggerProps[\"className\"];\n triggerProps?: DropdownMenuPrimitive.DropdownMenuTriggerProps;\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 classNames,\n triggerClassname,\n triggerProps,\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\n asChild\n className={cn(classNames?.trigger, triggerClassname)}\n {...triggerProps}\n >\n {trigger}\n </DropdownMenuTrigger>\n <Portal>\n <DropdownMenuContent\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n className,\n classNames?.content,\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 <Portal>\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 </Portal>\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 classNames?.item,\n )}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuItem>\n );\n }\n })}\n </DropdownMenuContent>\n </Portal>\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,mBAAuB;AACvB,4BAAuC;;;ACHvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADKA,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,S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;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 { Portal } from \"@headlessui/react\";\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 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 <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 </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 = \"a\", ...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 classNames?: {\n trigger?: string;\n content?: string;\n item?: string;\n };\n className?: ExtendedDropdownMenuContentProps[\"className\"];\n triggerClassname?: ExtendedDropdownMenuTriggerProps[\"className\"];\n triggerProps?: DropdownMenuPrimitive.DropdownMenuTriggerProps;\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 classNames,\n triggerClassname,\n triggerProps,\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\n asChild\n className={cn(classNames?.trigger, triggerClassname)}\n {...triggerProps}\n >\n {trigger}\n </DropdownMenuTrigger>\n <Portal>\n <DropdownMenuContent\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n className,\n classNames?.content,\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 <Portal>\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 </Portal>\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 classNames?.item,\n )}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuItem>\n );\n }\n })}\n </DropdownMenuContent>\n </Portal>\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 DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n Portal as DropdownMenuPortal,\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,mBAAuB;AACvB,4BAAuC;;;ACHvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADGA,IAAM,mBAAyC;AAC/C,IAAM,sBAA4C;AAClD,IAAM,oBAA0C;AAChD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IAAI;AAAA,gBACf,CAAC,KAAK,QAAQ,CAAC,KAAK,QAChB,mDACA;AAAA,gBACJ,KAAK,WAAW;AAAA,gBAChB,yCAAY;AAAA,cACd;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":[]}
|
@@ -16,7 +16,6 @@ function cn(...inputs) {
|
|
16
16
|
var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
17
17
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
18
18
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
19
|
-
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
20
19
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
21
20
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
22
21
|
var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
@@ -79,7 +78,7 @@ var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...prop
|
|
79
78
|
}
|
80
79
|
)));
|
81
80
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
82
|
-
var DropdownMenuItem = React.forwardRef(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {
|
81
|
+
var DropdownMenuItem = React.forwardRef(({ className, inset, badged, slug, LinkComponent = "a", ...props }, ref) => {
|
83
82
|
return /* @__PURE__ */ React.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React.createElement(
|
84
83
|
DropdownMenuPrimitive.Item,
|
85
84
|
{
|
@@ -408,7 +407,7 @@ export {
|
|
408
407
|
DropdownMenuGroup,
|
409
408
|
DropdownMenuItem,
|
410
409
|
DropdownMenuLabel,
|
411
|
-
DropdownMenuPortal,
|
410
|
+
Portal as DropdownMenuPortal,
|
412
411
|
DropdownMenuRadio,
|
413
412
|
DropdownMenuRadioGroup,
|
414
413
|
DropdownMenuRadioItem,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/dropdownMenu/DropdownMenu.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { Portal } from \"@headlessui/react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType, RadioOptionType } from \"../../types/commonTypes\";\n\n// New import\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 <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 </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 classNames?: {\n trigger?: string;\n content?: string;\n item?: string;\n };\n className?: ExtendedDropdownMenuContentProps[\"className\"];\n triggerClassname?: ExtendedDropdownMenuTriggerProps[\"className\"];\n triggerProps?: DropdownMenuPrimitive.DropdownMenuTriggerProps;\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 classNames,\n triggerClassname,\n triggerProps,\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\n asChild\n className={cn(classNames?.trigger, triggerClassname)}\n {...triggerProps}\n >\n {trigger}\n </DropdownMenuTrigger>\n <Portal>\n <DropdownMenuContent\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n className,\n classNames?.content,\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 <Portal>\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 </Portal>\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 classNames?.item,\n )}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuItem>\n );\n }\n })}\n </DropdownMenuContent>\n </Portal>\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,SAAS,cAAc;AACvB,YAAY,2BAA2B;;;ACHvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADKA,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,M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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/DropdownMenu.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { Portal } from \"@headlessui/react\";\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 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 <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 </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 = \"a\", ...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 classNames?: {\n trigger?: string;\n content?: string;\n item?: string;\n };\n className?: ExtendedDropdownMenuContentProps[\"className\"];\n triggerClassname?: ExtendedDropdownMenuTriggerProps[\"className\"];\n triggerProps?: DropdownMenuPrimitive.DropdownMenuTriggerProps;\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 classNames,\n triggerClassname,\n triggerProps,\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\n asChild\n className={cn(classNames?.trigger, triggerClassname)}\n {...triggerProps}\n >\n {trigger}\n </DropdownMenuTrigger>\n <Portal>\n <DropdownMenuContent\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n className,\n classNames?.content,\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 <Portal>\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 </Portal>\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 classNames?.item,\n )}\n >\n {item.icon && item.icon}\n {item.label && item.label}\n </DropdownMenuItem>\n );\n }\n })}\n </DropdownMenuContent>\n </Portal>\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 DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n Portal as DropdownMenuPortal,\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,SAAS,cAAc;AACvB,YAAY,2BAA2B;;;ACHvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADGA,IAAM,mBAAyC;AAC/C,IAAM,sBAA4C;AAClD,IAAM,oBAA0C;AAChD,IAAM,kBAAwC;AAC9C,IAAM,yBAA+C;AAErD,IAAM,yBAA+B,iBAKnC,CAAC,EAAE,WAAW,OAAO,UAA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B,yCAAY;AAAA,cACd;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":[]}
|
@@ -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-C-g8nFFC.mjs';
|
5
|
-
export { D as DropdownMenu, f as DropdownMenuCheckboxItem, d as DropdownMenuContent, k as DropdownMenuGroup, e as DropdownMenuItem, h as DropdownMenuLabel,
|
5
|
+
export { D as DropdownMenu, f as DropdownMenuCheckboxItem, d as DropdownMenuContent, k as DropdownMenuGroup, e as DropdownMenuItem, h as DropdownMenuLabel, b as DropdownMenuRadio, o as DropdownMenuRadioGroup, g as DropdownMenuRadioItem, a as DropdownMenuRoot, i as DropdownMenuSeparator, j as DropdownMenuShortcut, l as DropdownMenuSub, m as DropdownMenuSubContent, n as DropdownMenuSubTrigger, c as DropdownMenuTrigger, M as MenuItemType, S as SubItem } from '../DropdownMenu-Dly5lsqz.mjs';
|
6
6
|
import { a as ChipTypes } from '../Chip-CGl24Kd9.mjs';
|
7
7
|
export { b as Chip, C as ChipColors } from '../Chip-CGl24Kd9.mjs';
|
8
8
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
@@ -29,6 +29,7 @@ import { HighlightProps } from 'prism-react-renderer';
|
|
29
29
|
import { EmblaOptionsType } from 'embla-carousel';
|
30
30
|
import { T as ToasterToastProps } from '../Toast-BcFD9aeQ.mjs';
|
31
31
|
export { e as Toast, i as ToastAction, b as ToastActionElement, h as ToastClose, g as ToastDescription, a as ToastProps, c as ToastProvider, f as ToastTitle, d as ToastViewport } from '../Toast-BcFD9aeQ.mjs';
|
32
|
+
export { Portal as DropdownMenuPortal } from '@headlessui/react';
|
32
33
|
import '@radix-ui/react-dropdown-menu';
|
33
34
|
import '@radix-ui/react-toast';
|
34
35
|
|
package/dist/elements/index.d.ts
CHANGED
@@ -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-C-g8nFFC.js';
|
5
|
-
export { D as DropdownMenu, f as DropdownMenuCheckboxItem, d as DropdownMenuContent, k as DropdownMenuGroup, e as DropdownMenuItem, h as DropdownMenuLabel,
|
5
|
+
export { D as DropdownMenu, f as DropdownMenuCheckboxItem, d as DropdownMenuContent, k as DropdownMenuGroup, e as DropdownMenuItem, h as DropdownMenuLabel, b as DropdownMenuRadio, o as DropdownMenuRadioGroup, g as DropdownMenuRadioItem, a as DropdownMenuRoot, i as DropdownMenuSeparator, j as DropdownMenuShortcut, l as DropdownMenuSub, m as DropdownMenuSubContent, n as DropdownMenuSubTrigger, c as DropdownMenuTrigger, M as MenuItemType, S as SubItem } from '../DropdownMenu-Cxlm5lZl.js';
|
6
6
|
import { a as ChipTypes } from '../Chip-Cato49ar.js';
|
7
7
|
export { b as Chip, C as ChipColors } from '../Chip-Cato49ar.js';
|
8
8
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
@@ -29,6 +29,7 @@ import { HighlightProps } from 'prism-react-renderer';
|
|
29
29
|
import { EmblaOptionsType } from 'embla-carousel';
|
30
30
|
import { T as ToasterToastProps } from '../Toast-fy9tBz19.js';
|
31
31
|
export { e as Toast, i as ToastAction, b as ToastActionElement, h as ToastClose, g as ToastDescription, a as ToastProps, c as ToastProvider, f as ToastTitle, d as ToastViewport } from '../Toast-fy9tBz19.js';
|
32
|
+
export { Portal as DropdownMenuPortal } from '@headlessui/react';
|
32
33
|
import '@radix-ui/react-dropdown-menu';
|
33
34
|
import '@radix-ui/react-toast';
|
34
35
|
|
package/dist/elements/index.js
CHANGED
@@ -88,7 +88,7 @@ __export(elements_exports, {
|
|
88
88
|
DropdownMenuGroup: () => DropdownMenuGroup,
|
89
89
|
DropdownMenuItem: () => DropdownMenuItem,
|
90
90
|
DropdownMenuLabel: () => DropdownMenuLabel,
|
91
|
-
DropdownMenuPortal: () =>
|
91
|
+
DropdownMenuPortal: () => import_react4.Portal,
|
92
92
|
DropdownMenuRadio: () => DropdownMenuRadio,
|
93
93
|
DropdownMenuRadioGroup: () => DropdownMenuRadioGroup,
|
94
94
|
DropdownMenuRadioItem: () => DropdownMenuRadioItem,
|
@@ -635,7 +635,6 @@ var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
635
635
|
var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
636
636
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
637
637
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
638
|
-
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
639
638
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
640
639
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
641
640
|
var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React5.createElement(
|
@@ -698,7 +697,7 @@ var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, ...pro
|
|
698
697
|
}
|
699
698
|
)));
|
700
699
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
701
|
-
var DropdownMenuItem = React5.forwardRef(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {
|
700
|
+
var DropdownMenuItem = React5.forwardRef(({ className, inset, badged, slug, LinkComponent = "a", ...props }, ref) => {
|
702
701
|
return /* @__PURE__ */ React5.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React5.createElement(
|
703
702
|
DropdownMenuPrimitive.Item,
|
704
703
|
{
|
package/dist/elements/index.mjs
CHANGED
@@ -26,7 +26,7 @@ import {
|
|
26
26
|
TabsList,
|
27
27
|
TabsTrigger,
|
28
28
|
Textarea
|
29
|
-
} from "../chunk-
|
29
|
+
} from "../chunk-RZJPAN5T.mjs";
|
30
30
|
import {
|
31
31
|
useClipboard
|
32
32
|
} from "../chunk-ZBUBNKF6.mjs";
|
@@ -41,7 +41,7 @@ import {
|
|
41
41
|
SheetPortal,
|
42
42
|
SheetTitle,
|
43
43
|
SheetTrigger
|
44
|
-
} from "../chunk-
|
44
|
+
} from "../chunk-GZVEFVSJ.mjs";
|
45
45
|
import {
|
46
46
|
Button,
|
47
47
|
Card,
|
@@ -58,7 +58,6 @@ import {
|
|
58
58
|
DropdownMenuGroup,
|
59
59
|
DropdownMenuItem,
|
60
60
|
DropdownMenuLabel,
|
61
|
-
DropdownMenuPortal,
|
62
61
|
DropdownMenuRadio,
|
63
62
|
DropdownMenuRadioGroup,
|
64
63
|
DropdownMenuRadioItem,
|
@@ -75,13 +74,14 @@ import {
|
|
75
74
|
Label,
|
76
75
|
Loading,
|
77
76
|
Logos,
|
77
|
+
Portal,
|
78
78
|
Skeleton,
|
79
79
|
Tooltip,
|
80
80
|
UncheckMark,
|
81
81
|
buttonVariants,
|
82
82
|
calculateLuminance,
|
83
83
|
cn
|
84
|
-
} from "../chunk-
|
84
|
+
} from "../chunk-GVPIM5KC.mjs";
|
85
85
|
import {
|
86
86
|
__require
|
87
87
|
} from "../chunk-SYGWSBJL.mjs";
|
@@ -3497,7 +3497,7 @@ export {
|
|
3497
3497
|
DropdownMenuGroup,
|
3498
3498
|
DropdownMenuItem,
|
3499
3499
|
DropdownMenuLabel,
|
3500
|
-
DropdownMenuPortal,
|
3500
|
+
Portal as DropdownMenuPortal,
|
3501
3501
|
DropdownMenuRadio,
|
3502
3502
|
DropdownMenuRadioGroup,
|
3503
3503
|
DropdownMenuRadioItem,
|
package/dist/index.d.mts
CHANGED
@@ -25,6 +25,7 @@ import { HighlightProps } from 'prism-react-renderer';
|
|
25
25
|
import { EmblaOptionsType } from 'embla-carousel';
|
26
26
|
import * as ToastPrimitives from '@radix-ui/react-toast';
|
27
27
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
28
|
+
export { Portal as DropdownMenuPortal } from '@headlessui/react';
|
28
29
|
|
29
30
|
interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
30
31
|
clickable?: boolean;
|
@@ -107,7 +108,6 @@ declare function Skeleton({ className, content, animation, fade, ...props }: Ske
|
|
107
108
|
declare const DropdownMenuRoot: React$1.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
108
109
|
declare const DropdownMenuTrigger: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
109
110
|
declare const DropdownMenuGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
110
|
-
declare const DropdownMenuPortal: React$1.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
111
111
|
declare const DropdownMenuSub: React$1.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
112
112
|
declare const DropdownMenuRadioGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
113
113
|
declare const DropdownMenuSubTrigger: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
@@ -2242,4 +2242,4 @@ type HotkeyItem = [
|
|
2242
2242
|
];
|
2243
2243
|
declare function useShortcuts(hotkeys: HotkeyItem[], tagsToIgnore?: string[], triggerOnContentEditable?: boolean): void;
|
2244
2244
|
|
2245
|
-
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppCommand, AppLanding, AppLayout, type AppSidebarItemProps, AppStores, AppTabs, AppTopbar, AuthButtons, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, type ChipColors, type ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, ContactForm, type ContentRect, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel,
|
2245
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppCommand, AppLanding, AppLayout, type AppSidebarItemProps, AppStores, AppTabs, AppTopbar, AuthButtons, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, type ChipColors, type ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, ContactForm, type ContentRect, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadio, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, FileUploader, FullCommand, type FullCommandItem, HorizontalPricing, type Hotkey, type HotkeyItem, type HotkeyItemOptions, Input, InterfaceSettings, ItemCard, type KeyboardModifiers, Label, type LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, type MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem$1 as NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, NewPasswordForm, NoPermission, NotFound, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, type PhoneInputProps, PhoneMockup, PinInput, PinInputGroup, PinInputRoot, PinInputSeperator, PinInputSlot, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, type RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, type SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, Stats, StopPropagationWrapper, type SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, type TextFieldTypes, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToasterToastProps, Tooltip, Usage, type UseFocusWithinOptions, type UseMediaQueryOptions, UserReferralSource, buttonVariants, getHotkeyHandler, getHotkeyMatcher, navigationMenuTriggerStyle, parseHotkey, reducer, toast, useBreakpoint, useClickOutside, useClipboard, useDialogCarousel, useFocusWithin, useIsomorphicEffect, useMeasureDirty, useMediaQuery, useMultiStepDialog, useShortcuts, useTabs, useToast, useWindowSize };
|