@sikka/hawa 0.38.6-next → 0.38.7-next

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/command/Command.tsx","../../util/index.ts","../../elements/dialog/Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { DialogProps, DialogPortal, Dialog } from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\nimport { Command as CommandPrimitive } from \"cmdk\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport { DialogContent } from \"../dialog\";\n\ninterface CommandProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive> {\n // Include additional props if necessary\n}\n\ninterface CommandDialogProps extends DialogProps {}\n\nexport interface CommandInputProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> {}\n\ninterface CommandListProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> {}\n\ninterface CommandEmptyProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> {}\n\ninterface CommandGroupProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> {}\n\ninterface CommandSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> {}\n\ninterface CommandItemProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> {}\n\ninterface CommandShortcutProps extends React.HTMLAttributes<HTMLSpanElement> {}\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n CommandProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-overflow-hidden hawa-rounded-md hawa-bg-popover hawa-text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"hawa-overflow-hidden hawa-p-0 hawa-shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:hawa-pt-0 [&_[cmdk-group]]:hawa-px-2 [&_[cmdk-input-wrapper]_svg]:hawa-h-5 [&_[cmdk-input-wrapper]_svg]:hawa-w-5 [&_[cmdk-input]]:hawa-h-12 [&_[cmdk-item]]:hawa-px-2 [&_[cmdk-item]]:hawa-py-3 [&_[cmdk-item]_svg]:hawa-h-5 [&_[cmdk-item]_svg]:hawa-w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n CommandInputProps\n>(({ className, ...props }, ref) => (\n <div\n className=\"hawa-flex hawa-items-center hawa-border-b hawa-px-3\"\n cmdk-input-wrapper=\"\"\n >\n <svg\n aria-label=\"Search Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon hawa-me-2 hawa-shrink-0 hawa-opacity-50\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-11 hawa-w-full hawa-rounded-md hawa-bg-transparent hawa-py-3 hawa-text-sm hawa-outline-none placeholder:hawa-text-muted-foreground disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n CommandListProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n \"hawa-max-h-[300px] hawa-overflow-y-auto hawa-overflow-x-hidden\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n CommandEmptyProps\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"hawa-py-6 hawa-text-center hawa-text-sm\"\n {...props}\n />\n));\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n CommandGroupProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"hawa-overflow-hidden hawa-p-1 hawa-text-foreground [&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-py-1.5 [&_[cmdk-group-heading]]:hawa-text-xs [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n CommandSeparatorProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-h-px hawa-bg-border\", className)}\n {...props}\n />\n));\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n CommandItemProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none aria-selected:hawa-bg-accent aria-selected:hawa-text-accent-foreground data-[disabled='true']:hawa-pointer-events-none data-[disabled='true']:hawa-opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement> & CommandShortcutProps) => {\n return (\n <span\n className={cn(\n \"hawa-ms-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\n\nexport type FullCommandItem = {\n type: \"group\" | \"separator\";\n heading?: string;\n items?: {\n icon: React.ElementType;\n label: string | React.ReactNode;\n action: () => void;\n shortcut?: string;\n }[];\n};\ntype FullCommandProps = {\n items: FullCommandItem[];\n direction?: DirectionType;\n onActionClick?: () => void;\n texts?: {\n searchPlaceholder?: string;\n emptyText?: string;\n };\n};\n\nconst FullCommand = ({\n items,\n direction = \"ltr\",\n texts,\n onActionClick,\n}: FullCommandProps) => {\n return (\n <Command\n dir={direction}\n className=\"hawa-rounded-lg hawa-border hawa-shadow-md !hawa-h-full\"\n >\n <CommandInput\n placeholder={texts?.searchPlaceholder || \"Type a command or search...\"}\n />\n <CommandList>\n <CommandEmpty>{texts?.emptyText || \"No results found.\"}</CommandEmpty>\n {items.map((item, index) => {\n if (item.type === \"group\") {\n return (\n <CommandGroup heading={item.heading} key={index}>\n {item.items?.map((subItem, subIndex) => (\n <CommandItem\n key={subIndex}\n onSelect={() => {\n if (onActionClick) onActionClick();\n subItem.action();\n }}\n >\n <subItem.icon className=\"hawa-icon hawa-me-2\" />\n <span>{subItem.label}</span>\n {subItem.shortcut && (\n <CommandShortcut>{subItem.shortcut}</CommandShortcut>\n )}\n </CommandItem>\n ))}\n </CommandGroup>\n );\n } else if (item.type === \"separator\") {\n return <CommandSeparator key={index} />;\n }\n return null;\n })}\n </CommandList>\n </Command>\n );\n};\n\ntype AppCommandProps = {\n commandProps: Omit<FullCommandProps, \"onActionClick\">;\n dialogProps: DialogProps;\n onActionClick?: () => void;\n};\nconst AppCommand = ({\n commandProps,\n dialogProps,\n onActionClick,\n}: AppCommandProps) => {\n return (\n <Dialog {...dialogProps}>\n <DialogContent\n hideCloseButton\n className=\"hawa-overflow-hidden !hawa-p-0 hawa-shadow-l \"\n // !hawa-min-h-[50%]\n >\n <FullCommand {...commandProps} onActionClick={onActionClick} />\n </DialogContent>\n </Dialog>\n );\n};\n\nCommandShortcut.displayName = \"CommandShortcut\";\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nCommandList.displayName = CommandPrimitive.List.displayName;\nCommand.displayName = CommandPrimitive.displayName;\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nexport {\n AppCommand,\n FullCommand,\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal {...props} />\n);\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n persist?: boolean;\n hideCloseButton?: boolean;\n container?: HTMLElement;\n classNames?: {\n content?: string;\n overlay?: string;\n closeButton?: string;\n };\n }\n>(\n (\n { className, classNames, children, persist, hideCloseButton, ...props },\n ref,\n ) => (\n <DialogPortal container={props.container}>\n <DialogOverlay className={classNames?.overlay} />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-[90%] hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n classNames?.closeButton,\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-5 hawa-w-5\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogCarouselContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n hideCloseButton?: boolean;\n hidePrevButton?: boolean;\n persist?: boolean;\n onPrev?: () => void;\n }\n>(\n (\n {\n className,\n children,\n onPrev,\n persist,\n hideCloseButton,\n hidePrevButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <div\n className={cn(\n \"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4\",\n onPrev ? \"hawa-justify-between\" : \"hawa-justify-end\",\n )}\n >\n {hidePrevButton ? (\n <div />\n ) : (\n <div\n onClick={onPrev}\n className={cn(\n \"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" && \"hawa-rotate-180\",\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"hawa-h-6 hawa-w-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </div>\n )}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground \",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-6 hawa-w-6\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left\",\n className,\n )}\n {...props}\n />\n);\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-sm hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2\",\n className,\n )}\n {...props}\n />\n);\ninterface DialogCarouselProps {\n children: React.ReactNode;\n stepsApi?: any;\n stepsRef?: any;\n direction?: DirectionType;\n}\nconst DialogCarousel: React.FC<DialogCarouselProps> = ({\n stepsApi,\n stepsRef,\n children,\n direction,\n}) => {\n React.useEffect(() => {\n if (stepsApi) {\n stepsApi.reInit();\n }\n }, [stepsApi, children]);\n return (\n <div className=\"hawa-overflow-hidden\">\n <div ref={stepsRef} dir={direction}>\n <div\n className=\"hawa-flex\"\n style={{\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n className={cn(\n \"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\",\n )}\n key={index}\n >\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\ninterface DialogStepsProps {\n currentStep: string;\n // TODO: update this name\n visibleStepRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}\nconst DialogSteps: React.FC<DialogStepsProps> = ({\n currentStep,\n visibleStepRef,\n children,\n}) => {\n const [dialogHeight, setDialogHeight] = React.useState<any>(null);\n React.useEffect(() => {\n if (visibleStepRef.current) {\n setDialogHeight(visibleStepRef.current.offsetHeight);\n console.log(\"height is \", visibleStepRef.current.offsetHeight);\n }\n }, [currentStep, visibleStepRef]);\n\n return (\n <div\n className=\"hawa-relative hawa-overflow-clip\"\n style={{\n height: dialogHeight || \"fit-content\",\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n ref={currentStep === `step-${index + 1}` ? visibleStepRef : null}\n className={cn(\n currentStep === `step-${index + 1}`\n ? \"hawa-visible hawa-block\"\n : \"hawa-invisible hawa-hidden\",\n )}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\ninterface DialogStepProps {\n id: string;\n children: React.ReactNode;\n className?: string;\n stepRef?: any;\n}\nconst DialogStep: React.FC<DialogStepProps> = ({\n id,\n children,\n className,\n stepRef,\n}) => {\n return (\n <div\n id={id}\n ref={stepRef}\n className={cn(\"hawa-w-full hawa-px-1\", className)}\n >\n {children}\n </div>\n );\n};\ninterface DialogBodyProps {\n children: React.ReactNode;\n className?: string;\n}\nconst DialogBody: React.FC<DialogBodyProps> = ({ children, className }) => {\n return <div className={cn(\"hawa-py-6\", className)}>{children}</div>;\n};\n\nDialogBody.displayName = \"DialogBody\";\nDialogStep.displayName = \"DialogStep\";\nDialogSteps.displayName = \"DialogSteps\";\nDialogCarousel.displayName = \"DialogCarousel\";\nDialogCarouselContent.displayName = \"DialogCarouselContent\";\nDialogHeader.displayName = \"DialogHeader\";\nDialogFooter.displayName = \"DialogFooter\";\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogCarousel,\n DialogCarouselContent,\n DialogSteps,\n DialogStep,\n DialogBody,\n DialogDescription,\n};\n"],"mappings":";;;AAAA,YAAYA,YAAW;AAEvB,SAAoC,cAAc;;;ACFlD,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADDA,SAAS,WAAW,wBAAwB;;;AEJ5C,YAAY,WAAW;AAEvB,YAAY,qBAAqB;AASjC,IAAM,eAAe,CAAC,EAAE,GAAG,MAAM,MAC/B,oCAAiB,wBAAhB,EAAwB,GAAG,OAAO;AAErC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,IAAM,gBAAsB;AAAA,EAa1B,CACE,EAAE,WAAW,YAAY,UAAU,SAAS,iBAAiB,GAAG,MAAM,GACtE,QAEA,oCAAC,gBAAa,WAAW,MAAM,aAC7B,oCAAC,iBAAc,WAAW,yCAAY,SAAS,GAC/C;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC,sBAAsB,CAAC,MAAM;AAC3B,YAAI,SAAS;AACX,YAAE,eAAe;AAAA,QACnB;AAAA,MACF;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,IAEH;AAAA,IACA,CAAC,mBACA;AAAA,MAAiB;AAAA,MAAhB;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,MAAM,QAAQ,QAAQ,iBAAiB;AAAA,UACvC,yCAAY;AAAA,QACd;AAAA;AAAA,MA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EJ;AAEA,gBAAgB,cAAc;AAC9B,YAAY,cAAc,iBAAiB,KAAK;AAChD,iBAAiB,cAAc,iBAAiB,UAAU;AAC1D,aAAa,cAAc,iBAAiB,MAAM;AAClD,aAAa,cAAc,iBAAiB,MAAM;AAClD,YAAY,cAAc,iBAAiB,KAAK;AAChD,QAAQ,cAAc,iBAAiB;AACvC,aAAa,cAAc,iBAAiB,MAAM;","names":["React"]}
1
+ {"version":3,"sources":["../../elements/command/Command.tsx","../../util/index.ts","../../elements/dialog/Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { DialogProps, DialogPortal, Dialog } from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\nimport { Command as CommandPrimitive } from \"cmdk\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport { DialogContent } from \"../dialog\";\n\ninterface CommandProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive> {\n // Include additional props if necessary\n}\n\ninterface CommandDialogProps extends DialogProps {}\n\nexport interface CommandInputProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> {}\n\ninterface CommandListProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> {}\n\ninterface CommandEmptyProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> {}\n\ninterface CommandGroupProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> {}\n\ninterface CommandSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> {}\n\ninterface CommandItemProps\n extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> {}\n\ninterface CommandShortcutProps extends React.HTMLAttributes<HTMLSpanElement> {}\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n CommandProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-overflow-hidden hawa-rounded-md hawa-bg-popover hawa-text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"hawa-overflow-hidden hawa-p-0 hawa-shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:hawa-pt-0 [&_[cmdk-group]]:hawa-px-2 [&_[cmdk-input-wrapper]_svg]:hawa-h-5 [&_[cmdk-input-wrapper]_svg]:hawa-w-5 [&_[cmdk-input]]:hawa-h-12 [&_[cmdk-item]]:hawa-px-2 [&_[cmdk-item]]:hawa-py-3 [&_[cmdk-item]_svg]:hawa-h-5 [&_[cmdk-item]_svg]:hawa-w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n CommandInputProps\n>(({ className, ...props }, ref) => (\n <div\n className=\"hawa-flex hawa-items-center hawa-border-b hawa-px-3\"\n cmdk-input-wrapper=\"\"\n >\n <svg\n aria-label=\"Search Icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-icon hawa-me-2 hawa-shrink-0 hawa-opacity-50\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"hawa-flex hawa-h-11 hawa-w-full hawa-rounded-md hawa-bg-transparent hawa-py-3 hawa-text-sm hawa-outline-none placeholder:hawa-text-muted-foreground disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n CommandListProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n \"hawa-max-h-[300px] hawa-overflow-y-auto hawa-overflow-x-hidden\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n CommandEmptyProps\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"hawa-py-6 hawa-text-center hawa-text-sm\"\n {...props}\n />\n));\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n CommandGroupProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"hawa-overflow-hidden hawa-p-1 hawa-text-foreground [&_[cmdk-group-heading]]:hawa-px-2 [&_[cmdk-group-heading]]:hawa-py-1.5 [&_[cmdk-group-heading]]:hawa-text-xs [&_[cmdk-group-heading]]:hawa-font-medium [&_[cmdk-group-heading]]:hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n CommandSeparatorProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"hawa--mx-1 hawa-h-px hawa-bg-border\", className)}\n {...props}\n />\n));\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n CommandItemProps\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none aria-selected:hawa-bg-accent aria-selected:hawa-text-accent-foreground data-[disabled='true']:hawa-pointer-events-none data-[disabled='true']:hawa-opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement> & CommandShortcutProps) => {\n return (\n <span\n className={cn(\n \"hawa-ms-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\n\nexport type FullCommandItem = {\n type: \"group\" | \"separator\";\n heading?: string;\n items?: {\n icon: React.ElementType;\n label: string | React.ReactNode;\n action: () => void;\n shortcut?: string;\n }[];\n};\ntype FullCommandProps = {\n items: FullCommandItem[];\n direction?: DirectionType;\n onActionClick?: () => void;\n texts?: {\n searchPlaceholder?: string;\n emptyText?: string;\n };\n};\n\nconst FullCommand = ({\n items,\n direction = \"ltr\",\n texts,\n onActionClick,\n}: FullCommandProps) => {\n return (\n <Command\n dir={direction}\n className=\"hawa-rounded-lg hawa-border hawa-shadow-md !hawa-h-full\"\n >\n <CommandInput\n placeholder={texts?.searchPlaceholder || \"Type a command or search...\"}\n />\n <CommandList>\n <CommandEmpty>{texts?.emptyText || \"No results found.\"}</CommandEmpty>\n {items.map((item, index) => {\n if (item.type === \"group\") {\n return (\n <CommandGroup heading={item.heading} key={index}>\n {item.items?.map((subItem, subIndex) => (\n <CommandItem\n key={subIndex}\n onSelect={() => {\n if (onActionClick) onActionClick();\n subItem.action();\n }}\n >\n <subItem.icon className=\"hawa-icon hawa-me-2\" />\n <span>{subItem.label}</span>\n {subItem.shortcut && (\n <CommandShortcut>{subItem.shortcut}</CommandShortcut>\n )}\n </CommandItem>\n ))}\n </CommandGroup>\n );\n } else if (item.type === \"separator\") {\n return <CommandSeparator key={index} />;\n }\n return null;\n })}\n </CommandList>\n </Command>\n );\n};\n\ntype AppCommandProps = {\n commandProps: Omit<FullCommandProps, \"onActionClick\">;\n dialogProps: DialogProps;\n onActionClick?: () => void;\n};\nconst AppCommand = ({\n commandProps,\n dialogProps,\n onActionClick,\n}: AppCommandProps) => {\n return (\n <Dialog {...dialogProps}>\n <DialogContent\n hideCloseButton\n className=\"hawa-overflow-hidden !hawa-p-0 hawa-shadow-l \"\n // !hawa-min-h-[50%]\n >\n <FullCommand {...commandProps} onActionClick={onActionClick} />\n </DialogContent>\n </Dialog>\n );\n};\n\nCommandShortcut.displayName = \"CommandShortcut\";\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nCommandList.displayName = CommandPrimitive.List.displayName;\nCommand.displayName = CommandPrimitive.displayName;\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nexport {\n AppCommand,\n FullCommand,\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal {...props} />\n);\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n persist?: boolean;\n hideCloseButton?: boolean;\n container?: HTMLElement;\n classNames?: {\n content?: string;\n overlay?: string;\n closeButton?: string;\n };\n ids?: {\n overlay?: string;\n closeButton?: string;\n closeIcon?: string;\n };\n }\n>(\n (\n {\n ids,\n className,\n classNames,\n children,\n persist,\n hideCloseButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal container={props.container}>\n <DialogOverlay className={classNames?.overlay} id={ids?.overlay} />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-[90%] hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n classNames?.closeButton,\n )}\n id={ids?.closeButton}\n >\n <svg\n id={ids?.closeIcon}\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-5 hawa-w-5\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogCarouselContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n hideCloseButton?: boolean;\n hidePrevButton?: boolean;\n persist?: boolean;\n onPrev?: () => void;\n }\n>(\n (\n {\n className,\n children,\n onPrev,\n persist,\n hideCloseButton,\n hidePrevButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <div\n className={cn(\n \"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4\",\n onPrev ? \"hawa-justify-between\" : \"hawa-justify-end\",\n )}\n >\n {hidePrevButton ? (\n <div />\n ) : (\n <div\n onClick={onPrev}\n className={cn(\n \"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" && \"hawa-rotate-180\",\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"hawa-h-6 hawa-w-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </div>\n )}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground \",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-6 hawa-w-6\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left\",\n className,\n )}\n {...props}\n />\n);\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-sm hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2\",\n className,\n )}\n {...props}\n />\n);\ninterface DialogCarouselProps {\n children: React.ReactNode;\n stepsApi?: any;\n stepsRef?: any;\n direction?: DirectionType;\n}\nconst DialogCarousel: React.FC<DialogCarouselProps> = ({\n stepsApi,\n stepsRef,\n children,\n direction,\n}) => {\n React.useEffect(() => {\n if (stepsApi) {\n stepsApi.reInit();\n }\n }, [stepsApi, children]);\n return (\n <div className=\"hawa-overflow-hidden\">\n <div ref={stepsRef} dir={direction}>\n <div\n className=\"hawa-flex\"\n style={{\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n className={cn(\n \"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\",\n )}\n key={index}\n >\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\ninterface DialogStepsProps {\n currentStep: string;\n // TODO: update this name\n visibleStepRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}\nconst DialogSteps: React.FC<DialogStepsProps> = ({\n currentStep,\n visibleStepRef,\n children,\n}) => {\n const [dialogHeight, setDialogHeight] = React.useState<any>(null);\n React.useEffect(() => {\n if (visibleStepRef.current) {\n setDialogHeight(visibleStepRef.current.offsetHeight);\n console.log(\"height is \", visibleStepRef.current.offsetHeight);\n }\n }, [currentStep, visibleStepRef]);\n\n return (\n <div\n className=\"hawa-relative hawa-overflow-clip\"\n style={{\n height: dialogHeight || \"fit-content\",\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n ref={currentStep === `step-${index + 1}` ? visibleStepRef : null}\n className={cn(\n currentStep === `step-${index + 1}`\n ? \"hawa-visible hawa-block\"\n : \"hawa-invisible hawa-hidden\",\n )}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\ninterface DialogStepProps {\n id: string;\n children: React.ReactNode;\n className?: string;\n stepRef?: any;\n}\nconst DialogStep: React.FC<DialogStepProps> = ({\n id,\n children,\n className,\n stepRef,\n}) => {\n return (\n <div\n id={id}\n ref={stepRef}\n className={cn(\"hawa-w-full hawa-px-1\", className)}\n >\n {children}\n </div>\n );\n};\ninterface DialogBodyProps {\n children: React.ReactNode;\n className?: string;\n}\nconst DialogBody: React.FC<DialogBodyProps> = ({ children, className }) => {\n return <div className={cn(\"hawa-py-6\", className)}>{children}</div>;\n};\n\nDialogBody.displayName = \"DialogBody\";\nDialogStep.displayName = \"DialogStep\";\nDialogSteps.displayName = \"DialogSteps\";\nDialogCarousel.displayName = \"DialogCarousel\";\nDialogCarouselContent.displayName = \"DialogCarouselContent\";\nDialogHeader.displayName = \"DialogHeader\";\nDialogFooter.displayName = \"DialogFooter\";\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogCarousel,\n DialogCarouselContent,\n DialogSteps,\n DialogStep,\n DialogBody,\n DialogDescription,\n};\n"],"mappings":";;;AAAA,YAAYA,YAAW;AAEvB,SAAoC,cAAc;;;ACFlD,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADDA,SAAS,WAAW,wBAAwB;;;AEJ5C,YAAY,WAAW;AAEvB,YAAY,qBAAqB;AASjC,IAAM,eAAe,CAAC,EAAE,GAAG,MAAM,MAC/B,oCAAiB,wBAAhB,EAAwB,GAAG,OAAO;AAErC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,IAAM,gBAAsB;AAAA,EAkB1B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QAEA,oCAAC,gBAAa,WAAW,MAAM,aAC7B,oCAAC,iBAAc,WAAW,yCAAY,SAAS,IAAI,2BAAK,SAAS,GACjE;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC,sBAAsB,CAAC,MAAM;AAC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,WAAW,KAAK,SAAS,aAAa;AACpC,eAAO,qCAAC,oBAAiB,KAAK,OAAO;AAAA,MACvC;AACA,aAAO;AAAA,IACT,CAAC,CACH;AAAA,EACF;AAEJ;AAOA,IAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACrB,SACE,qCAAC,UAAQ,GAAG,eACV;AAAA,IAAC;AAAA;AAAA,MACC,iBAAe;AAAA,MACf,WAAU;AAAA;AAAA,IAGV,qCAAC,eAAa,GAAG,cAAc,eAA8B;AAAA,EAC/D,CACF;AAEJ;AAEA,gBAAgB,cAAc;AAC9B,YAAY,cAAc,iBAAiB,KAAK;AAChD,iBAAiB,cAAc,iBAAiB,UAAU;AAC1D,aAAa,cAAc,iBAAiB,MAAM;AAClD,aAAa,cAAc,iBAAiB,MAAM;AAClD,YAAY,cAAc,iBAAiB,KAAK;AAChD,QAAQ,cAAc,iBAAiB;AACvC,aAAa,cAAc,iBAAiB,MAAM;","names":["React"]}
@@ -17,6 +17,11 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitiv
17
17
  overlay?: string | undefined;
18
18
  closeButton?: string | undefined;
19
19
  } | undefined;
20
+ ids?: {
21
+ overlay?: string | undefined;
22
+ closeButton?: string | undefined;
23
+ closeIcon?: string | undefined;
24
+ } | undefined;
20
25
  } & React.RefAttributes<HTMLDivElement>>;
21
26
  declare const DialogCarouselContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
22
27
  hideCloseButton?: boolean | undefined;
@@ -17,6 +17,11 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitiv
17
17
  overlay?: string | undefined;
18
18
  closeButton?: string | undefined;
19
19
  } | undefined;
20
+ ids?: {
21
+ overlay?: string | undefined;
22
+ closeButton?: string | undefined;
23
+ closeIcon?: string | undefined;
24
+ } | undefined;
20
25
  } & React.RefAttributes<HTMLDivElement>>;
21
26
  declare const DialogCarouselContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
22
27
  hideCloseButton?: boolean | undefined;
@@ -74,7 +74,15 @@ var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
74
74
  }
75
75
  ));
76
76
  var DialogContent = React.forwardRef(
77
- ({ className, classNames, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React.createElement(DialogOverlay, { className: classNames == null ? void 0 : classNames.overlay }), /* @__PURE__ */ React.createElement(
77
+ ({
78
+ ids,
79
+ className,
80
+ classNames,
81
+ children,
82
+ persist,
83
+ hideCloseButton,
84
+ ...props
85
+ }, ref) => /* @__PURE__ */ React.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React.createElement(DialogOverlay, { className: classNames == null ? void 0 : classNames.overlay, id: ids == null ? void 0 : ids.overlay }), /* @__PURE__ */ React.createElement(
78
86
  DialogPrimitive.Content,
79
87
  {
80
88
  onPointerDownOutside: (e) => {
@@ -97,11 +105,13 @@ var DialogContent = React.forwardRef(
97
105
  "hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground",
98
106
  props.dir === "rtl" ? " hawa-left-4" : " hawa-right-4",
99
107
  classNames == null ? void 0 : classNames.closeButton
100
- )
108
+ ),
109
+ id: ids == null ? void 0 : ids.closeButton
101
110
  },
102
111
  /* @__PURE__ */ React.createElement(
103
112
  "svg",
104
113
  {
114
+ id: ids == null ? void 0 : ids.closeIcon,
105
115
  "aria-label": "Close Icon",
106
116
  "aria-hidden": "true",
107
117
  className: "hawa-h-5 hawa-w-5",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/dialog/index.ts","../../elements/dialog/Dialog.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Dialog\";\n","import * as React from \"react\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal {...props} />\n);\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n persist?: boolean;\n hideCloseButton?: boolean;\n container?: HTMLElement;\n classNames?: {\n content?: string;\n overlay?: string;\n closeButton?: string;\n };\n }\n>(\n (\n { className, classNames, children, persist, hideCloseButton, ...props },\n ref,\n ) => (\n <DialogPortal container={props.container}>\n <DialogOverlay className={classNames?.overlay} />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-[90%] hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n classNames?.closeButton,\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-5 hawa-w-5\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogCarouselContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n hideCloseButton?: boolean;\n hidePrevButton?: boolean;\n persist?: boolean;\n onPrev?: () => void;\n }\n>(\n (\n {\n className,\n children,\n onPrev,\n persist,\n hideCloseButton,\n hidePrevButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <div\n className={cn(\n \"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4\",\n onPrev ? \"hawa-justify-between\" : \"hawa-justify-end\",\n )}\n >\n {hidePrevButton ? (\n <div />\n ) : (\n <div\n onClick={onPrev}\n className={cn(\n \"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" && \"hawa-rotate-180\",\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"hawa-h-6 hawa-w-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </div>\n )}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground \",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-6 hawa-w-6\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left\",\n className,\n )}\n {...props}\n />\n);\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-sm hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2\",\n className,\n )}\n {...props}\n />\n);\ninterface DialogCarouselProps {\n children: React.ReactNode;\n stepsApi?: any;\n stepsRef?: any;\n direction?: DirectionType;\n}\nconst DialogCarousel: React.FC<DialogCarouselProps> = ({\n stepsApi,\n stepsRef,\n children,\n direction,\n}) => {\n React.useEffect(() => {\n if (stepsApi) {\n stepsApi.reInit();\n }\n }, [stepsApi, children]);\n return (\n <div className=\"hawa-overflow-hidden\">\n <div ref={stepsRef} dir={direction}>\n <div\n className=\"hawa-flex\"\n style={{\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n className={cn(\n \"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\",\n )}\n key={index}\n >\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\ninterface DialogStepsProps {\n currentStep: string;\n // TODO: update this name\n visibleStepRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}\nconst DialogSteps: React.FC<DialogStepsProps> = ({\n currentStep,\n visibleStepRef,\n children,\n}) => {\n const [dialogHeight, setDialogHeight] = React.useState<any>(null);\n React.useEffect(() => {\n if (visibleStepRef.current) {\n setDialogHeight(visibleStepRef.current.offsetHeight);\n console.log(\"height is \", visibleStepRef.current.offsetHeight);\n }\n }, [currentStep, visibleStepRef]);\n\n return (\n <div\n className=\"hawa-relative hawa-overflow-clip\"\n style={{\n height: dialogHeight || \"fit-content\",\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n ref={currentStep === `step-${index + 1}` ? visibleStepRef : null}\n className={cn(\n currentStep === `step-${index + 1}`\n ? \"hawa-visible hawa-block\"\n : \"hawa-invisible hawa-hidden\",\n )}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\ninterface DialogStepProps {\n id: string;\n children: React.ReactNode;\n className?: string;\n stepRef?: any;\n}\nconst DialogStep: React.FC<DialogStepProps> = ({\n id,\n children,\n className,\n stepRef,\n}) => {\n return (\n <div\n id={id}\n ref={stepRef}\n className={cn(\"hawa-w-full hawa-px-1\", className)}\n >\n {children}\n </div>\n );\n};\ninterface DialogBodyProps {\n children: React.ReactNode;\n className?: string;\n}\nconst DialogBody: React.FC<DialogBodyProps> = ({ children, className }) => {\n return <div className={cn(\"hawa-py-6\", className)}>{children}</div>;\n};\n\nDialogBody.displayName = \"DialogBody\";\nDialogStep.displayName = \"DialogStep\";\nDialogSteps.displayName = \"DialogSteps\";\nDialogCarousel.displayName = \"DialogCarousel\";\nDialogCarouselContent.displayName = \"DialogCarouselContent\";\nDialogHeader.displayName = \"DialogHeader\";\nDialogFooter.displayName = \"DialogFooter\";\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogCarousel,\n DialogCarouselContent,\n DialogSteps,\n DialogStep,\n DialogBody,\n DialogDescription,\n};\n","import { 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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,GAAG,aAAa,SAAS,KAAI,QAAS;AAC/D;AAEA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,YAAY,cAAc;AAC1B,eAAe,cAAc;AAC7B,sBAAsB,cAAc;AACpC,aAAa,cAAc;AAC3B,aAAa,cAAc;AAC3B,YAAY,cAA8B,sBAAM;AAChD,aAAa,cAA8B,uBAAO;AAClD,cAAc,cAA8B,wBAAQ;AACpD,cAAc,cAA8B,wBAAQ;AACpD,kBAAkB,cAA8B,4BAAY;","names":[]}
1
+ {"version":3,"sources":["../../elements/dialog/index.ts","../../elements/dialog/Dialog.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Dialog\";\n","import * as React from \"react\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal {...props} />\n);\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n persist?: boolean;\n hideCloseButton?: boolean;\n container?: HTMLElement;\n classNames?: {\n content?: string;\n overlay?: string;\n closeButton?: string;\n };\n ids?: {\n overlay?: string;\n closeButton?: string;\n closeIcon?: string;\n };\n }\n>(\n (\n {\n ids,\n className,\n classNames,\n children,\n persist,\n hideCloseButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal container={props.container}>\n <DialogOverlay className={classNames?.overlay} id={ids?.overlay} />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-[90%] hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n classNames?.closeButton,\n )}\n id={ids?.closeButton}\n >\n <svg\n id={ids?.closeIcon}\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-5 hawa-w-5\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogCarouselContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n hideCloseButton?: boolean;\n hidePrevButton?: boolean;\n persist?: boolean;\n onPrev?: () => void;\n }\n>(\n (\n {\n className,\n children,\n onPrev,\n persist,\n hideCloseButton,\n hidePrevButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <div\n className={cn(\n \"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4\",\n onPrev ? \"hawa-justify-between\" : \"hawa-justify-end\",\n )}\n >\n {hidePrevButton ? (\n <div />\n ) : (\n <div\n onClick={onPrev}\n className={cn(\n \"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" && \"hawa-rotate-180\",\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"hawa-h-6 hawa-w-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </div>\n )}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground \",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-6 hawa-w-6\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left\",\n className,\n )}\n {...props}\n />\n);\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-sm hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2\",\n className,\n )}\n {...props}\n />\n);\ninterface DialogCarouselProps {\n children: React.ReactNode;\n stepsApi?: any;\n stepsRef?: any;\n direction?: DirectionType;\n}\nconst DialogCarousel: React.FC<DialogCarouselProps> = ({\n stepsApi,\n stepsRef,\n children,\n direction,\n}) => {\n React.useEffect(() => {\n if (stepsApi) {\n stepsApi.reInit();\n }\n }, [stepsApi, children]);\n return (\n <div className=\"hawa-overflow-hidden\">\n <div ref={stepsRef} dir={direction}>\n <div\n className=\"hawa-flex\"\n style={{\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n className={cn(\n \"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\",\n )}\n key={index}\n >\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\ninterface DialogStepsProps {\n currentStep: string;\n // TODO: update this name\n visibleStepRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}\nconst DialogSteps: React.FC<DialogStepsProps> = ({\n currentStep,\n visibleStepRef,\n children,\n}) => {\n const [dialogHeight, setDialogHeight] = React.useState<any>(null);\n React.useEffect(() => {\n if (visibleStepRef.current) {\n setDialogHeight(visibleStepRef.current.offsetHeight);\n console.log(\"height is \", visibleStepRef.current.offsetHeight);\n }\n }, [currentStep, visibleStepRef]);\n\n return (\n <div\n className=\"hawa-relative hawa-overflow-clip\"\n style={{\n height: dialogHeight || \"fit-content\",\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n ref={currentStep === `step-${index + 1}` ? visibleStepRef : null}\n className={cn(\n currentStep === `step-${index + 1}`\n ? \"hawa-visible hawa-block\"\n : \"hawa-invisible hawa-hidden\",\n )}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\ninterface DialogStepProps {\n id: string;\n children: React.ReactNode;\n className?: string;\n stepRef?: any;\n}\nconst DialogStep: React.FC<DialogStepProps> = ({\n id,\n children,\n className,\n stepRef,\n}) => {\n return (\n <div\n id={id}\n ref={stepRef}\n className={cn(\"hawa-w-full hawa-px-1\", className)}\n >\n {children}\n </div>\n );\n};\ninterface DialogBodyProps {\n children: React.ReactNode;\n className?: string;\n}\nconst DialogBody: React.FC<DialogBodyProps> = ({ children, className }) => {\n return <div className={cn(\"hawa-py-6\", className)}>{children}</div>;\n};\n\nDialogBody.displayName = \"DialogBody\";\nDialogStep.displayName = \"DialogStep\";\nDialogSteps.displayName = \"DialogSteps\";\nDialogCarousel.displayName = \"DialogCarousel\";\nDialogCarouselContent.displayName = \"DialogCarouselContent\";\nDialogHeader.displayName = \"DialogHeader\";\nDialogFooter.displayName = \"DialogFooter\";\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogCarousel,\n DialogCarouselContent,\n DialogSteps,\n DialogStep,\n DialogBody,\n DialogDescription,\n};\n","import { 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;;;ACAA,YAAuB;AAEvB,sBAAiC;;;ACFjC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADEA,IAAM,SAAyB;AAE/B,IAAM,gBAAgC;AAEtC,IAAM,eAAe,CAAC,EAAE,GAAG,MAAM,MAC/B,oCAAiB,wBAAhB,EAAwB,GAAG,OAAO;AAErC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,IAAM,gBAAsB;AAAA,EAkB1B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QAEA,oCAAC,gBAAa,WAAW,MAAM,aAC7B,oCAAC,iBAAc,WAAW,yCAAY,SAAS,IAAI,2BAAK,SAAS,GACjE;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC,sBAAsB,CAAC,MAAM;A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,eAAS,IAAI,UAAU,CAAC,OAAO,UACpC;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,gBAAgB,QAAQ,QAAQ,CAAC,KAAK,iBAAiB;AAAA,QAC5D,WAAW;AAAA,UACT,gBAAgB,QAAQ,QAAQ,CAAC,KAC7B,4BACA;AAAA,QACN;AAAA;AAAA,MAEC;AAAA,IACH,CACD;AAAA,EACH;AAEJ;AAOA,IAAM,aAAwC,CAAC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,KAAK;AAAA,MACL,WAAW,GAAG,0BAA0B,SAAS;AAAA;AAAA,IAEhD;AAAA,EACH;AAEJ;AAKA,IAAM,aAAwC,CAAC,EAAE,UAAU,UAAU,MAAM;AACzE,SAAO,oCAAC,SAAI,WAAW,GAAG,aAAa,SAAS,KAAI,QAAS;AAC/D;AAEA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,YAAY,cAAc;AAC1B,eAAe,cAAc;AAC7B,sBAAsB,cAAc;AACpC,aAAa,cAAc;AAC3B,aAAa,cAAc;AAC3B,YAAY,cAA8B,sBAAM;AAChD,aAAa,cAA8B,uBAAO;AAClD,cAAc,cAA8B,wBAAQ;AACpD,cAAc,cAA8B,wBAAQ;AACpD,kBAAkB,cAA8B,4BAAY;","names":[]}
@@ -27,7 +27,15 @@ var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
27
27
  }
28
28
  ));
29
29
  var DialogContent = React.forwardRef(
30
- ({ className, classNames, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React.createElement(DialogOverlay, { className: classNames == null ? void 0 : classNames.overlay }), /* @__PURE__ */ React.createElement(
30
+ ({
31
+ ids,
32
+ className,
33
+ classNames,
34
+ children,
35
+ persist,
36
+ hideCloseButton,
37
+ ...props
38
+ }, ref) => /* @__PURE__ */ React.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React.createElement(DialogOverlay, { className: classNames == null ? void 0 : classNames.overlay, id: ids == null ? void 0 : ids.overlay }), /* @__PURE__ */ React.createElement(
31
39
  DialogPrimitive.Content,
32
40
  {
33
41
  onPointerDownOutside: (e) => {
@@ -50,11 +58,13 @@ var DialogContent = React.forwardRef(
50
58
  "hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground",
51
59
  props.dir === "rtl" ? " hawa-left-4" : " hawa-right-4",
52
60
  classNames == null ? void 0 : classNames.closeButton
53
- )
61
+ ),
62
+ id: ids == null ? void 0 : ids.closeButton
54
63
  },
55
64
  /* @__PURE__ */ React.createElement(
56
65
  "svg",
57
66
  {
67
+ id: ids == null ? void 0 : ids.closeIcon,
58
68
  "aria-label": "Close Icon",
59
69
  "aria-hidden": "true",
60
70
  className: "hawa-h-5 hawa-w-5",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/dialog/Dialog.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal {...props} />\n);\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n persist?: boolean;\n hideCloseButton?: boolean;\n container?: HTMLElement;\n classNames?: {\n content?: string;\n overlay?: string;\n closeButton?: string;\n };\n }\n>(\n (\n { className, classNames, children, persist, hideCloseButton, ...props },\n ref,\n ) => (\n <DialogPortal container={props.container}>\n <DialogOverlay className={classNames?.overlay} />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-[90%] hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n classNames?.closeButton,\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-5 hawa-w-5\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogCarouselContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n hideCloseButton?: boolean;\n hidePrevButton?: boolean;\n persist?: boolean;\n onPrev?: () => void;\n }\n>(\n (\n {\n className,\n children,\n onPrev,\n persist,\n hideCloseButton,\n hidePrevButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <div\n className={cn(\n \"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4\",\n onPrev ? \"hawa-justify-between\" : \"hawa-justify-end\",\n )}\n >\n {hidePrevButton ? (\n <div />\n ) : (\n <div\n onClick={onPrev}\n className={cn(\n \"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" && \"hawa-rotate-180\",\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"hawa-h-6 hawa-w-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </div>\n )}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground \",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-6 hawa-w-6\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left\",\n className,\n )}\n {...props}\n />\n);\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-sm hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2\",\n className,\n )}\n {...props}\n />\n);\ninterface DialogCarouselProps {\n children: React.ReactNode;\n stepsApi?: any;\n stepsRef?: any;\n direction?: DirectionType;\n}\nconst DialogCarousel: React.FC<DialogCarouselProps> = ({\n stepsApi,\n stepsRef,\n children,\n direction,\n}) => {\n React.useEffect(() => {\n if (stepsApi) {\n stepsApi.reInit();\n }\n }, [stepsApi, children]);\n return (\n <div className=\"hawa-overflow-hidden\">\n <div ref={stepsRef} dir={direction}>\n <div\n className=\"hawa-flex\"\n style={{\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n className={cn(\n \"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\",\n )}\n key={index}\n >\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\ninterface DialogStepsProps {\n currentStep: string;\n // TODO: update this name\n visibleStepRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}\nconst DialogSteps: React.FC<DialogStepsProps> = ({\n currentStep,\n visibleStepRef,\n children,\n}) => {\n const [dialogHeight, setDialogHeight] = React.useState<any>(null);\n React.useEffect(() => {\n if (visibleStepRef.current) {\n setDialogHeight(visibleStepRef.current.offsetHeight);\n console.log(\"height is \", visibleStepRef.current.offsetHeight);\n }\n }, [currentStep, visibleStepRef]);\n\n return (\n <div\n className=\"hawa-relative hawa-overflow-clip\"\n style={{\n height: dialogHeight || \"fit-content\",\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n ref={currentStep === `step-${index + 1}` ? visibleStepRef : null}\n className={cn(\n currentStep === `step-${index + 1}`\n ? \"hawa-visible hawa-block\"\n : \"hawa-invisible hawa-hidden\",\n )}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\ninterface DialogStepProps {\n id: string;\n children: React.ReactNode;\n className?: string;\n stepRef?: any;\n}\nconst DialogStep: React.FC<DialogStepProps> = ({\n id,\n children,\n className,\n stepRef,\n}) => {\n return (\n <div\n id={id}\n ref={stepRef}\n className={cn(\"hawa-w-full hawa-px-1\", className)}\n >\n {children}\n </div>\n );\n};\ninterface DialogBodyProps {\n children: React.ReactNode;\n className?: string;\n}\nconst DialogBody: React.FC<DialogBodyProps> = ({ children, className }) => {\n return <div className={cn(\"hawa-py-6\", className)}>{children}</div>;\n};\n\nDialogBody.displayName = \"DialogBody\";\nDialogStep.displayName = \"DialogStep\";\nDialogSteps.displayName = \"DialogSteps\";\nDialogCarousel.displayName = \"DialogCarousel\";\nDialogCarouselContent.displayName = \"DialogCarouselContent\";\nDialogHeader.displayName = \"DialogHeader\";\nDialogFooter.displayName = \"DialogFooter\";\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogCarousel,\n DialogCarouselContent,\n DialogSteps,\n DialogStep,\n DialogBody,\n DialogDescription,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;AAAA,YAAY,WAAW;AAEvB,YAAY,qBAAqB;;;ACFjC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADEA,IAAM,SAAyB;AAE/B,IAAM,gBAAgC;AAEtC,IAAM,eAAe,CAAC,EAAE,GAAG,MAAM,MAC/B,oCAAiB,wBAAhB,EAAwB,GAAG,OAAO;AAErC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,IAAM,gBAAsB;AAAA,EAa1B,CACE,EAAE,WAAW,YAAY,UAAU,SAAS,iBAAiB,GAAG,MAAM,GACtE,QAEA,oCAAC,gBAAa,WAAW,MAAM,aAC7B,oCAAC,iBAAc,W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xB,YAAY;AAAA,MACd;AAAA;AAAA,IAEO,eAAS,IAAI,UAAU,CAAC,OAAO,UACpC;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,gBAAgB,QAAQ,QAAQ,CAAC,KAAK,iBAAiB;AAAA,QAC5D,WAAW;AAAA,UACT,gBAAgB,QAAQ,QAAQ,CAAC,KAC7B,4BACA;AAAA,QACN;AAAA;AAAA,MAEC;AAAA,IACH,CACD;AAAA,EACH;AAEJ;AAOA,IAAM,aAAwC,CAAC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,KAAK;AAAA,MACL,WAAW,GAAG,0BAA0B,SAAS;AAAA;AAAA,IAEhD;AAAA,EACH;AAEJ;AAKA,IAAM,aAAwC,CAAC,EAAE,UAAU,UAAU,MAAM;AACzE,SAAO,oCAAC,SAAI,WAAW,GAAG,aAAa,SAAS,KAAI,QAAS;AAC/D;AAEA,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,YAAY,cAAc;AAC1B,eAAe,cAAc;AAC7B,sBAAsB,cAAc;AACpC,aAAa,cAAc;AAC3B,aAAa,cAAc;AAC3B,YAAY,cAA8B,sBAAM;AAChD,aAAa,cAA8B,uBAAO;AAClD,cAAc,cAA8B,wBAAQ;AACpD,cAAc,cAA8B,wBAAQ;AACpD,kBAAkB,cAA8B,4BAAY;","names":[]}
1
+ {"version":3,"sources":["../../elements/dialog/Dialog.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal {...props} />\n);\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n persist?: boolean;\n hideCloseButton?: boolean;\n container?: HTMLElement;\n classNames?: {\n content?: string;\n overlay?: string;\n closeButton?: string;\n };\n ids?: {\n overlay?: string;\n closeButton?: string;\n closeIcon?: string;\n };\n }\n>(\n (\n {\n ids,\n className,\n classNames,\n children,\n persist,\n hideCloseButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal container={props.container}>\n <DialogOverlay className={classNames?.overlay} id={ids?.overlay} />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-[90%] hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n classNames?.closeButton,\n )}\n id={ids?.closeButton}\n >\n <svg\n id={ids?.closeIcon}\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-5 hawa-w-5\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogCarouselContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n hideCloseButton?: boolean;\n hidePrevButton?: boolean;\n persist?: boolean;\n onPrev?: () => void;\n }\n>(\n (\n {\n className,\n children,\n onPrev,\n persist,\n hideCloseButton,\n hidePrevButton,\n ...props\n },\n ref,\n ) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n onPointerDownOutside={(e) => {\n if (persist) {\n e.preventDefault();\n }\n }}\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-pt-14 hawa-shadow-lg hawa-transition-all hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <div\n className={cn(\n \"hawa-absolute hawa-top-0 hawa-flex hawa-w-full hawa-flex-row hawa-p-4\",\n onPrev ? \"hawa-justify-between\" : \"hawa-justify-end\",\n )}\n >\n {hidePrevButton ? (\n <div />\n ) : (\n <div\n onClick={onPrev}\n className={cn(\n \"hawa-end-0 hawa-cursor-pointer hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground\",\n props.dir === \"rtl\" && \"hawa-rotate-180\",\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n className=\"hawa-h-6 hawa-w-6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </div>\n )}\n {!hideCloseButton && (\n <DialogPrimitive.Close\n className={cn(\n \"hawa-end-0 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground \",\n props.dir === \"rtl\" ? \" hawa-left-4\" : \" hawa-right-4\",\n )}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-h-6 hawa-w-6\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n <span className=\"hawa-sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n </DialogPrimitive.Content>\n </DialogPortal>\n ),\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left\",\n className,\n )}\n {...props}\n />\n);\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\n \"hawa-text-start hawa-text-sm hawa-text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2\",\n className,\n )}\n {...props}\n />\n);\ninterface DialogCarouselProps {\n children: React.ReactNode;\n stepsApi?: any;\n stepsRef?: any;\n direction?: DirectionType;\n}\nconst DialogCarousel: React.FC<DialogCarouselProps> = ({\n stepsApi,\n stepsRef,\n children,\n direction,\n}) => {\n React.useEffect(() => {\n if (stepsApi) {\n stepsApi.reInit();\n }\n }, [stepsApi, children]);\n return (\n <div className=\"hawa-overflow-hidden\">\n <div ref={stepsRef} dir={direction}>\n <div\n className=\"hawa-flex\"\n style={{\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n className={cn(\n \"hawa-flex hawa-h-fit hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\",\n )}\n key={index}\n >\n {child}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\ninterface DialogStepsProps {\n currentStep: string;\n // TODO: update this name\n visibleStepRef: React.RefObject<HTMLDivElement>;\n children: React.ReactNode;\n}\nconst DialogSteps: React.FC<DialogStepsProps> = ({\n currentStep,\n visibleStepRef,\n children,\n}) => {\n const [dialogHeight, setDialogHeight] = React.useState<any>(null);\n React.useEffect(() => {\n if (visibleStepRef.current) {\n setDialogHeight(visibleStepRef.current.offsetHeight);\n console.log(\"height is \", visibleStepRef.current.offsetHeight);\n }\n }, [currentStep, visibleStepRef]);\n\n return (\n <div\n className=\"hawa-relative hawa-overflow-clip\"\n style={{\n height: dialogHeight || \"fit-content\",\n transition: \"height 0.2s\",\n }}\n >\n {React.Children.map(children, (child, index) => (\n <div\n ref={currentStep === `step-${index + 1}` ? visibleStepRef : null}\n className={cn(\n currentStep === `step-${index + 1}`\n ? \"hawa-visible hawa-block\"\n : \"hawa-invisible hawa-hidden\",\n )}\n >\n {child}\n </div>\n ))}\n </div>\n );\n};\ninterface DialogStepProps {\n id: string;\n children: React.ReactNode;\n className?: string;\n stepRef?: any;\n}\nconst DialogStep: React.FC<DialogStepProps> = ({\n id,\n children,\n className,\n stepRef,\n}) => {\n return (\n <div\n id={id}\n ref={stepRef}\n className={cn(\"hawa-w-full hawa-px-1\", className)}\n >\n {children}\n </div>\n );\n};\ninterface DialogBodyProps {\n children: React.ReactNode;\n className?: string;\n}\nconst DialogBody: React.FC<DialogBodyProps> = ({ children, className }) => {\n return <div className={cn(\"hawa-py-6\", className)}>{children}</div>;\n};\n\nDialogBody.displayName = \"DialogBody\";\nDialogStep.displayName = \"DialogStep\";\nDialogSteps.displayName = \"DialogSteps\";\nDialogCarousel.displayName = \"DialogCarousel\";\nDialogCarouselContent.displayName = \"DialogCarouselContent\";\nDialogHeader.displayName = \"DialogHeader\";\nDialogFooter.displayName = \"DialogFooter\";\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogCarousel,\n DialogCarouselContent,\n DialogSteps,\n DialogStep,\n DialogBody,\n DialogDescription,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;AAAA,YAAY,WAAW;AAEvB,YAAY,qBAAqB;;;ACFjC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADEA,IAAM,SAAyB;AAE/B,IAAM,gBAAgC;AAEtC,IAAM,eAAe,CAAC,EAAE,GAAG,MAAM,MAC/B,oCAAiB,wBAAhB,EAAwB,GAAG,OAAO;AAErC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GA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AA8B,wBAAQ;AACpD,kBAAkB,cAA8B,4BAAY;","names":[]}
@@ -230,6 +230,11 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<SheetPrimitive
230
230
  overlay?: string | undefined;
231
231
  closeButton?: string | undefined;
232
232
  } | undefined;
233
+ ids?: {
234
+ overlay?: string | undefined;
235
+ closeButton?: string | undefined;
236
+ closeIcon?: string | undefined;
237
+ } | undefined;
233
238
  } & React.RefAttributes<HTMLDivElement>>;
234
239
  declare const DialogCarouselContent: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
235
240
  hideCloseButton?: boolean | undefined;
@@ -230,6 +230,11 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<SheetPrimitive
230
230
  overlay?: string | undefined;
231
231
  closeButton?: string | undefined;
232
232
  } | undefined;
233
+ ids?: {
234
+ overlay?: string | undefined;
235
+ closeButton?: string | undefined;
236
+ closeIcon?: string | undefined;
237
+ } | undefined;
233
238
  } & React.RefAttributes<HTMLDivElement>>;
234
239
  declare const DialogCarouselContent: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
235
240
  hideCloseButton?: boolean | undefined;
@@ -1904,7 +1904,15 @@ var DialogOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__P
1904
1904
  }
1905
1905
  ));
1906
1906
  var DialogContent = React14.forwardRef(
1907
- ({ className, classNames, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React14.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React14.createElement(DialogOverlay, { className: classNames == null ? void 0 : classNames.overlay }), /* @__PURE__ */ React14.createElement(
1907
+ ({
1908
+ ids,
1909
+ className,
1910
+ classNames,
1911
+ children,
1912
+ persist,
1913
+ hideCloseButton,
1914
+ ...props
1915
+ }, ref) => /* @__PURE__ */ React14.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React14.createElement(DialogOverlay, { className: classNames == null ? void 0 : classNames.overlay, id: ids == null ? void 0 : ids.overlay }), /* @__PURE__ */ React14.createElement(
1908
1916
  DialogPrimitive.Content,
1909
1917
  {
1910
1918
  onPointerDownOutside: (e) => {
@@ -1927,11 +1935,13 @@ var DialogContent = React14.forwardRef(
1927
1935
  "hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground",
1928
1936
  props.dir === "rtl" ? " hawa-left-4" : " hawa-right-4",
1929
1937
  classNames == null ? void 0 : classNames.closeButton
1930
- )
1938
+ ),
1939
+ id: ids == null ? void 0 : ids.closeButton
1931
1940
  },
1932
1941
  /* @__PURE__ */ React14.createElement(
1933
1942
  "svg",
1934
1943
  {
1944
+ id: ids == null ? void 0 : ids.closeIcon,
1935
1945
  "aria-label": "Close Icon",
1936
1946
  "aria-hidden": "true",
1937
1947
  className: "hawa-h-5 hawa-w-5",
@@ -393,7 +393,15 @@ var DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PU
393
393
  }
394
394
  ));
395
395
  var DialogContent = React6.forwardRef(
396
- ({ className, classNames, children, persist, hideCloseButton, ...props }, ref) => /* @__PURE__ */ React6.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React6.createElement(DialogOverlay, { className: classNames == null ? void 0 : classNames.overlay }), /* @__PURE__ */ React6.createElement(
396
+ ({
397
+ ids,
398
+ className,
399
+ classNames,
400
+ children,
401
+ persist,
402
+ hideCloseButton,
403
+ ...props
404
+ }, ref) => /* @__PURE__ */ React6.createElement(DialogPortal, { container: props.container }, /* @__PURE__ */ React6.createElement(DialogOverlay, { className: classNames == null ? void 0 : classNames.overlay, id: ids == null ? void 0 : ids.overlay }), /* @__PURE__ */ React6.createElement(
397
405
  DialogPrimitive.Content,
398
406
  {
399
407
  onPointerDownOutside: (e) => {
@@ -416,11 +424,13 @@ var DialogContent = React6.forwardRef(
416
424
  "hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground",
417
425
  props.dir === "rtl" ? " hawa-left-4" : " hawa-right-4",
418
426
  classNames == null ? void 0 : classNames.closeButton
419
- )
427
+ ),
428
+ id: ids == null ? void 0 : ids.closeButton
420
429
  },
421
430
  /* @__PURE__ */ React6.createElement(
422
431
  "svg",
423
432
  {
433
+ id: ids == null ? void 0 : ids.closeIcon,
424
434
  "aria-label": "Close Icon",
425
435
  "aria-hidden": "true",
426
436
  className: "hawa-h-5 hawa-w-5",
package/dist/index.d.mts CHANGED
@@ -364,6 +364,11 @@ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<SheetPrimiti
364
364
  overlay?: string | undefined;
365
365
  closeButton?: string | undefined;
366
366
  } | undefined;
367
+ ids?: {
368
+ overlay?: string | undefined;
369
+ closeButton?: string | undefined;
370
+ closeIcon?: string | undefined;
371
+ } | undefined;
367
372
  } & React$1.RefAttributes<HTMLDivElement>>;
368
373
  declare const DialogCarouselContent: React$1.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
369
374
  hideCloseButton?: boolean | undefined;