@sikka/hawa 0.45.0-next → 0.46.0-next

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/blocks/auth/index.js +14 -13
  2. package/dist/blocks/auth/index.mjs +14 -14
  3. package/dist/blocks/feedback/index.js +3 -1
  4. package/dist/blocks/feedback/index.mjs +2 -2
  5. package/dist/blocks/index.js +16 -14
  6. package/dist/blocks/index.mjs +1 -1
  7. package/dist/blocks/misc/index.js +1 -0
  8. package/dist/blocks/misc/index.mjs +1 -1
  9. package/dist/blocks/pricing/index.js +2 -1
  10. package/dist/blocks/pricing/index.mjs +1 -1
  11. package/dist/{chunk-LMYT23CT.mjs → chunk-D3B3MKLS.mjs} +1 -0
  12. package/dist/{chunk-QMNXTGM4.mjs → chunk-IEB2ANWU.mjs} +16 -14
  13. package/dist/{chunk-OE6XZ6LW.mjs → chunk-YABFWOF3.mjs} +2 -1
  14. package/dist/elements/index.js +16 -14
  15. package/dist/elements/index.mjs +1 -1
  16. package/dist/index.css +1 -1
  17. package/dist/index.js +16 -14
  18. package/dist/index.mjs +16 -14
  19. package/dist/interfaceSettings/index.js +2 -1
  20. package/dist/interfaceSettings/index.js.map +1 -1
  21. package/dist/interfaceSettings/index.mjs +2 -1
  22. package/dist/interfaceSettings/index.mjs.map +1 -1
  23. package/dist/phoneInput/index.js +1 -0
  24. package/dist/phoneInput/index.js.map +1 -1
  25. package/dist/phoneInput/index.mjs +1 -0
  26. package/dist/phoneInput/index.mjs.map +1 -1
  27. package/dist/pinInput/index.js +13 -13
  28. package/dist/pinInput/index.js.map +1 -1
  29. package/dist/pinInput/index.mjs +13 -13
  30. package/dist/pinInput/index.mjs.map +1 -1
  31. package/dist/radio/index.js +2 -1
  32. package/dist/radio/index.js.map +1 -1
  33. package/dist/radio/index.mjs +2 -1
  34. package/dist/radio/index.mjs.map +1 -1
  35. package/dist/select/index.js +1 -0
  36. package/dist/select/index.js.map +1 -1
  37. package/dist/select/index.mjs +1 -0
  38. package/dist/select/index.mjs.map +1 -1
  39. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/radio/Radio.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/popover/Popover.tsx"],"sourcesContent":["import React, { useState, FC, useRef, useEffect, forwardRef } from \"react\";\n\nimport { PopoverContentProps } from \"@radix-ui/react-popover\";\nimport { TabsList, TabsTrigger, Tabs } from \"@radix-ui/react-tabs\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType, OrientationType } from \"../../types/commonTypes\";\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from \"../popover\";\n\nexport type RadioOptionsTypes = {\n value: any;\n label: any;\n disabled?: any;\n sublabel?: any;\n icon?: any;\n tooltip?: string;\n tooltipContentProps?: PopoverContentProps;\n};\n\ntype RadioTypes = {\n /** Required to enable selection and differentiate between different Radio instances. */\n name: string;\n disabled?: boolean;\n orientation?: OrientationType;\n design?: \"default\" | \"tabs\" | \"cards\" | \"bordered\";\n width?: \"default\" | \"full\" | \"none\";\n size?: \"default\" | \"lg\" | \"sm\" | \"xs\";\n options: RadioOptionsTypes[];\n onChange?: any;\n defaultValue?: any;\n value?: any;\n direction?: DirectionType;\n helperText?: any;\n labelProps?: LabelProps;\n label?: string;\n tabsContainerClassName?: string;\n forceHideHelperText?: boolean;\n containerClassNames?: {\n bordered?: string;\n tabs?: string;\n cards?: string;\n default?: string;\n };\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioTypes>(\n (\n {\n design = \"default\",\n width = \"default\",\n size = \"default\",\n orientation = \"horizontal\",\n name,\n labelProps,\n tabsContainerClassName,\n forceHideHelperText = false,\n onChange,\n containerClassNames,\n ...props\n },\n ref,\n ) => {\n let activeTabStyle =\n \"hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary\";\n let inactiveTabStyle = `hawa-inline-block hawa-w-full hawa-transition-all hawa-bg-primary-foreground dark:hover:hawa-text-white\n ${props.disabled ? \"\" : \"hover:hawa-bg-muted\"}`;\n let orientationStyle = {\n horizontal: \"hawa-flex hawa-flex-row\",\n vertical: \"hawa-flex hawa-flex-col\",\n };\n\n let tabSizeStyle = {\n default: \"hawa-py-2 hawa-px-4 hawa-text-sm\",\n lg: \"hawa-py-2 hawa-px-4\",\n sm: \"hawa-p-1.5 hawa-text-xs\",\n xs: \"hawa-p-1 hawa-text-[10px]\",\n };\n let widthStyle = {\n none: \"\",\n default: \"hawa-max-w-fit\",\n full: \"hawa-w-full\",\n };\n const [parentDirection, setParentDirection] = React.useState<string | null>(\n null,\n );\n const [selectedOption, setSelectedOption] = useState(\n props.defaultValue || props.value,\n );\n const [openTooltip, setOpenTooltip] = useState<number | null>(null);\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const parentNode = parentRef.current?.parentNode as HTMLElement | null;\n if (parentNode) {\n const dir = window.getComputedStyle(parentNode).direction;\n setParentDirection(dir);\n }\n });\n\n const handleChange = (opt: RadioOptionsTypes) => {\n setSelectedOption(opt.value);\n if (onChange) {\n // use the more generic onChange prop\n onChange(opt.value); // You can pass the entire option or just the value\n } else {\n console.log(\"onChange was not provided\");\n }\n };\n\n const radio_option_tabs_styling = [\n \"hawa-w-full hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 \",\n !props.disabled && \"hawa-cursor-pointer\",\n orientation === \"horizontal\" &&\n parentDirection === \"ltr\" &&\n \"hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r\",\n orientation === \"horizontal\" &&\n parentDirection === \"rtl\" &&\n \"hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l\",\n orientation === \"vertical\" &&\n \"hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b\",\n tabSizeStyle[size],\n ];\n\n switch (design) {\n case \"tabs\":\n return (\n <div\n className={cn(\n \"hawa-gap-2 hawa-flex hawa-flex-col\",\n containerClassNames?.tabs,\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <Tabs>\n <TabsList\n role=\"tablist\"\n ref={parentRef}\n className={cn(\n props.options && props.options?.length > 2\n ? \"hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap\"\n : \"\",\n \"hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium hawa-h-[40px]\",\n orientationStyle[orientation],\n widthStyle[width],\n tabsContainerClassName,\n )}\n >\n {props.options?.map((opt, o) => {\n return opt.tooltip ? (\n <PopoverRoot\n key={o}\n open={o === openTooltip}\n onOpenChange={(bool) => setOpenTooltip(bool ? o : null)}\n >\n <PopoverTrigger\n onMouseEnter={() => setOpenTooltip(o)}\n onMouseLeave={() => setOpenTooltip(null)}\n asChild\n >\n <TabsTrigger\n aria-current={\n selectedOption === opt.value ? \"page\" : undefined\n }\n value={opt.value}\n role=\"tab\"\n tabIndex={0}\n onClick={() => {\n if (props.disabled || opt.disabled) return;\n handleChange(opt);\n }}\n className={cn(\n ...radio_option_tabs_styling,\n selectedOption === opt.value\n ? activeTabStyle\n : inactiveTabStyle,\n )}\n >\n {opt.icon && opt.icon}\n {opt.label}\n </TabsTrigger>\n </PopoverTrigger>\n <PopoverContent {...opt.tooltipContentProps}>\n {opt.tooltip}\n </PopoverContent>\n </PopoverRoot>\n ) : (\n <TabsTrigger\n key={o}\n role=\"tab\"\n tabIndex={0}\n aria-current={\n selectedOption === opt.value ? \"page\" : undefined\n }\n onClick={() => {\n if (props.disabled || opt.disabled) return;\n handleChange(opt);\n }}\n className={cn(\n ...radio_option_tabs_styling,\n selectedOption === opt.value\n ? activeTabStyle\n : inactiveTabStyle,\n )}\n value={opt.value}\n >\n {opt.icon && opt.icon}\n {opt.label}\n </TabsTrigger>\n );\n })}\n </TabsList>\n </Tabs>\n {!forceHideHelperText && (\n <HelperText helperText={props.helperText} />\n )}\n </div>\n );\n case \"bordered\":\n return (\n <div\n className={cn(\n orientationStyle[orientation],\n \"hawa-gap-4\",\n containerClassNames?.bordered,\n )}\n >\n {props.options &&\n props.options.map((opt, i) => (\n <div key={i} className=\"hawa-w-full hawa-rounded hawa-border\">\n <div\n className={cn(\n \"radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all\",\n props.direction === \"rtl\"\n ? \"margin-left right-19px\"\n : \"margin-right left-23px\",\n )}\n key={i + 1}\n >\n <input\n disabled={opt.disabled}\n id={opt.value.toString()}\n type=\"radio\"\n value={opt.value}\n name={name}\n onChange={() => handleChange(opt)}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-ml-2 hawa-w-full hawa-select-none hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium hawa-text-black dark:hawa-text-white\",\n opt.disabled\n ? \"hawa-opacity-50\"\n : \"hawa-cursor-pointer hawa-text-gray-900\",\n )}\n >\n {opt.label}\n </label>\n </div>\n </div>\n ))}\n </div>\n );\n case \"cards\":\n return (\n <ul\n className={cn(\n orientationStyle[orientation],\n \"hawa-gap-4\",\n containerClassNames?.cards,\n )}\n >\n {props.options?.map((opt: any, o) => (\n <li key={o} onClick={() => handleChange(opt)}>\n <input\n type=\"radio\"\n id={opt.value.toString()}\n name={name}\n value={opt.value.toString()}\n className=\"hawa-peer hawa-hidden\"\n required\n disabled={opt.disabled}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary\",\n opt.disabled\n ? \"hawa-opacity-50\"\n : \"hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300\",\n )}\n >\n <div className=\"hawa-block hawa-h-full hawa-w-full\">\n <div className=\"hawa-w-full hawa-text-lg hawa-font-semibold\">\n {opt.label}\n </div>\n <div className=\"hawa-w-full\">{opt.sublabel}</div>\n </div>\n </label>\n </li>\n ))}\n </ul>\n );\n\n default:\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n containerClassNames?.default,\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className={cn(orientationStyle[orientation], \"hawa-gap-2\")}>\n {props.options &&\n props.options.map((opt, i) => (\n <div\n className={cn(\n \"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all\",\n props.direction === \"rtl\"\n ? \"margin-left right-3px\"\n : \"margin-right left-3px\",\n )}\n key={i + 1}\n >\n <input\n // TODO: spread the usual radio props\n disabled={opt.disabled}\n id={opt.value.toString()}\n type=\"radio\"\n value={opt.value}\n name={name}\n onChange={() => handleChange(opt)}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-text-sm hawa-font-medium dark:hawa-text-white\",\n opt.disabled\n ? \"hawa-text-gray-400\"\n : \"hawa-cursor-pointer hawa-text-gray-900\",\n )}\n >\n {opt.label}\n </label>\n </div>\n ))}\n </div>\n <HelperText helperText={props.helperText} />\n </div>\n );\n }\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import * as React from \"react\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(\n (\n { className, align = \"center\", sideOffset = 4, container, ...props },\n ref,\n ) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n ),\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\ninterface PopoverProps {\n side?: PositionType;\n align?: \"start\" | \"center\" | \"end\";\n trigger?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n sideOffset?: number;\n disableTrigger?: any;\n width?: \"trigger\" | \"default\";\n open?: boolean;\n contentProps?: PopoverPrimitive.PopoverContentProps;\n triggerProps?: PopoverPrimitive.PopoverTriggerProps;\n}\n\ntype HawaPopoverTypes = PopoverProps &\n React.ComponentProps<typeof PopoverPrimitive.Root>;\n\nconst Popover: React.FC<HawaPopoverTypes> = ({\n trigger,\n children,\n className,\n align = \"center\",\n side,\n sideOffset = 4,\n open,\n width = \"default\",\n disableTrigger,\n contentProps,\n triggerProps,\n ...props\n}) => {\n let widthStyles = {\n trigger: \"var(--radix-popover-trigger-width)\",\n default: \"auto\",\n };\n\n return (\n <PopoverPrimitive.Root open={open} {...props}>\n <PopoverPrimitive.Trigger\n className=\"hawa-w-full\"\n disabled={disableTrigger}\n {...triggerProps}\n >\n {trigger}\n </PopoverPrimitive.Trigger>\n <PopoverContent\n side={side}\n className={className}\n align={align}\n sideOffset={sideOffset}\n style={{\n width: widthStyles[width],\n maxWidth: \"var(--radix-popover-content-available-width)\",\n maxHeight: \"var(--radix-popover-content-available-height)\",\n }}\n {...contentProps}\n >\n {children}\n </PopoverContent>\n </PopoverPrimitive.Root>\n );\n};\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\nconst PopoverPortal = PopoverPrimitive.Portal;\nconst PopoverRoot = PopoverPrimitive.Root;\n\nexport { Popover, PopoverPortal, PopoverRoot, PopoverContent, PopoverTrigger };\n"],"mappings":";;;AAAA,OAAOA,UAAS,UAAc,QAAQ,WAAW,cAAAC,mBAAkB;AAGnE,SAAS,UAAU,aAAa,YAAY;;;ACH5C,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,OA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forwardRef","React","React","React","React","forwardRef","React","_a"]}
1
+ {"version":3,"sources":["../../elements/radio/Radio.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/popover/Popover.tsx"],"sourcesContent":["import React, { useState, FC, useRef, useEffect, forwardRef } from \"react\";\n\nimport { PopoverContentProps } from \"@radix-ui/react-popover\";\nimport { TabsList, TabsTrigger, Tabs } from \"@radix-ui/react-tabs\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType, OrientationType } from \"../../types/commonTypes\";\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from \"../popover\";\n\nexport type RadioOptionsTypes = {\n value: any;\n label: any;\n disabled?: any;\n sublabel?: any;\n icon?: any;\n tooltip?: string;\n tooltipContentProps?: PopoverContentProps;\n};\n\ntype RadioTypes = {\n /** Required to enable selection and differentiate between different Radio instances. */\n name: string;\n disabled?: boolean;\n orientation?: OrientationType;\n design?: \"default\" | \"tabs\" | \"cards\" | \"bordered\";\n width?: \"default\" | \"full\" | \"none\";\n size?: \"default\" | \"lg\" | \"sm\" | \"xs\";\n options: RadioOptionsTypes[];\n onChange?: any;\n defaultValue?: any;\n value?: any;\n direction?: DirectionType;\n helperText?: any;\n labelProps?: LabelProps;\n label?: string;\n tabsContainerClassName?: string;\n forceHideHelperText?: boolean;\n containerClassNames?: {\n bordered?: string;\n tabs?: string;\n cards?: string;\n default?: string;\n };\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioTypes>(\n (\n {\n design = \"default\",\n width = \"default\",\n size = \"default\",\n orientation = \"horizontal\",\n name,\n labelProps,\n tabsContainerClassName,\n forceHideHelperText = false,\n onChange,\n containerClassNames,\n ...props\n },\n ref,\n ) => {\n let activeTabStyle =\n \"hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary\";\n let inactiveTabStyle = `hawa-inline-block hawa-w-full hawa-transition-all hawa-bg-primary-foreground dark:hover:hawa-text-white\n ${props.disabled ? \"\" : \"hover:hawa-bg-muted\"}`;\n let orientationStyle = {\n horizontal: \"hawa-flex hawa-flex-row\",\n vertical: \"hawa-flex hawa-flex-col\",\n };\n\n let tabSizeStyle = {\n default: \"hawa-py-2 hawa-px-4 hawa-text-sm\",\n lg: \"hawa-py-2 hawa-px-4\",\n sm: \"hawa-p-1.5 hawa-text-xs\",\n xs: \"hawa-p-1 hawa-text-[10px]\",\n };\n let widthStyle = {\n none: \"\",\n default: \"hawa-max-w-fit\",\n full: \"hawa-w-full\",\n };\n const [parentDirection, setParentDirection] = React.useState<string | null>(\n null,\n );\n const [selectedOption, setSelectedOption] = useState(\n props.defaultValue || props.value,\n );\n const [openTooltip, setOpenTooltip] = useState<number | null>(null);\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const parentNode = parentRef.current?.parentNode as HTMLElement | null;\n if (parentNode) {\n const dir = window.getComputedStyle(parentNode).direction;\n setParentDirection(dir);\n }\n });\n\n const handleChange = (opt: RadioOptionsTypes) => {\n setSelectedOption(opt.value);\n if (onChange) {\n // use the more generic onChange prop\n onChange(opt.value); // You can pass the entire option or just the value\n } else {\n console.log(\"onChange was not provided\");\n }\n };\n\n const radio_option_tabs_styling = [\n \"hawa-w-full hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 \",\n !props.disabled && \"hawa-cursor-pointer\",\n orientation === \"horizontal\" &&\n parentDirection === \"ltr\" &&\n \"hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r\",\n orientation === \"horizontal\" &&\n parentDirection === \"rtl\" &&\n \"hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l\",\n orientation === \"vertical\" &&\n \"hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b\",\n tabSizeStyle[size],\n ];\n\n switch (design) {\n case \"tabs\":\n return (\n <div\n className={cn(\n \"hawa-gap-2 hawa-flex hawa-flex-col\",\n containerClassNames?.tabs,\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <Tabs>\n <TabsList\n role=\"tablist\"\n ref={parentRef}\n className={cn(\n props.options && props.options?.length > 2\n ? \"hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap\"\n : \"\",\n \"hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium hawa-h-[40px]\",\n orientationStyle[orientation],\n widthStyle[width],\n tabsContainerClassName,\n props.direction === \"rtl\" ? \"hawa-flex-row-reverse\" : \"\",\n )}\n >\n {props.options?.map((opt, o) => {\n return opt.tooltip ? (\n <PopoverRoot\n key={o}\n open={o === openTooltip}\n onOpenChange={(bool) => setOpenTooltip(bool ? o : null)}\n >\n <PopoverTrigger\n onMouseEnter={() => setOpenTooltip(o)}\n onMouseLeave={() => setOpenTooltip(null)}\n asChild\n >\n <TabsTrigger\n aria-current={\n selectedOption === opt.value ? \"page\" : undefined\n }\n value={opt.value}\n role=\"tab\"\n tabIndex={0}\n onClick={() => {\n if (props.disabled || opt.disabled) return;\n handleChange(opt);\n }}\n className={cn(\n ...radio_option_tabs_styling,\n selectedOption === opt.value\n ? activeTabStyle\n : inactiveTabStyle,\n )}\n >\n {opt.icon && opt.icon}\n {opt.label}\n </TabsTrigger>\n </PopoverTrigger>\n <PopoverContent {...opt.tooltipContentProps}>\n {opt.tooltip}\n </PopoverContent>\n </PopoverRoot>\n ) : (\n <TabsTrigger\n key={o}\n role=\"tab\"\n tabIndex={0}\n aria-current={\n selectedOption === opt.value ? \"page\" : undefined\n }\n onClick={() => {\n if (props.disabled || opt.disabled) return;\n handleChange(opt);\n }}\n className={cn(\n ...radio_option_tabs_styling,\n selectedOption === opt.value\n ? activeTabStyle\n : inactiveTabStyle,\n )}\n value={opt.value}\n >\n {opt.icon && opt.icon}\n {opt.label}\n </TabsTrigger>\n );\n })}\n </TabsList>\n </Tabs>\n {!forceHideHelperText && (\n <HelperText helperText={props.helperText} />\n )}\n </div>\n );\n case \"bordered\":\n return (\n <div\n className={cn(\n orientationStyle[orientation],\n \"hawa-gap-4\",\n containerClassNames?.bordered,\n )}\n >\n {props.options &&\n props.options.map((opt, i) => (\n <div key={i} className=\"hawa-w-full hawa-rounded hawa-border\">\n <div\n className={cn(\n \"radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all\",\n props.direction === \"rtl\"\n ? \"margin-left right-19px\"\n : \"margin-right left-23px\",\n )}\n key={i + 1}\n >\n <input\n disabled={opt.disabled}\n id={opt.value.toString()}\n type=\"radio\"\n value={opt.value}\n name={name}\n onChange={() => handleChange(opt)}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-ml-2 hawa-w-full hawa-select-none hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium hawa-text-black dark:hawa-text-white\",\n opt.disabled\n ? \"hawa-opacity-50\"\n : \"hawa-cursor-pointer hawa-text-gray-900\",\n )}\n >\n {opt.label}\n </label>\n </div>\n </div>\n ))}\n </div>\n );\n case \"cards\":\n return (\n <ul\n className={cn(\n orientationStyle[orientation],\n \"hawa-gap-4\",\n containerClassNames?.cards,\n )}\n >\n {props.options?.map((opt: any, o) => (\n <li key={o} onClick={() => handleChange(opt)}>\n <input\n type=\"radio\"\n id={opt.value.toString()}\n name={name}\n value={opt.value.toString()}\n className=\"hawa-peer hawa-hidden\"\n required\n disabled={opt.disabled}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary\",\n opt.disabled\n ? \"hawa-opacity-50\"\n : \"hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300\",\n )}\n >\n <div className=\"hawa-block hawa-h-full hawa-w-full\">\n <div className=\"hawa-w-full hawa-text-lg hawa-font-semibold\">\n {opt.label}\n </div>\n <div className=\"hawa-w-full\">{opt.sublabel}</div>\n </div>\n </label>\n </li>\n ))}\n </ul>\n );\n\n default:\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n containerClassNames?.default,\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className={cn(orientationStyle[orientation], \"hawa-gap-2\")}>\n {props.options &&\n props.options.map((opt, i) => (\n <div\n className={cn(\n \"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all\",\n props.direction === \"rtl\"\n ? \"margin-left right-3px\"\n : \"margin-right left-3px\",\n )}\n key={i + 1}\n >\n <input\n // TODO: spread the usual radio props\n disabled={opt.disabled}\n id={opt.value.toString()}\n type=\"radio\"\n value={opt.value}\n name={name}\n onChange={() => handleChange(opt)}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-text-sm hawa-font-medium dark:hawa-text-white\",\n opt.disabled\n ? \"hawa-text-gray-400\"\n : \"hawa-cursor-pointer hawa-text-gray-900\",\n )}\n >\n {opt.label}\n </label>\n </div>\n ))}\n </div>\n <HelperText helperText={props.helperText} />\n </div>\n );\n }\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import * as React from \"react\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(\n (\n { className, align = \"center\", sideOffset = 4, container, ...props },\n ref,\n ) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n ),\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\ninterface PopoverProps {\n side?: PositionType;\n align?: \"start\" | \"center\" | \"end\";\n trigger?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n sideOffset?: number;\n disableTrigger?: any;\n width?: \"trigger\" | \"default\";\n open?: boolean;\n contentProps?: PopoverPrimitive.PopoverContentProps;\n triggerProps?: PopoverPrimitive.PopoverTriggerProps;\n}\n\ntype HawaPopoverTypes = PopoverProps &\n React.ComponentProps<typeof PopoverPrimitive.Root>;\n\nconst Popover: React.FC<HawaPopoverTypes> = ({\n trigger,\n children,\n className,\n align = \"center\",\n side,\n sideOffset = 4,\n open,\n width = \"default\",\n disableTrigger,\n contentProps,\n triggerProps,\n ...props\n}) => {\n let widthStyles = {\n trigger: \"var(--radix-popover-trigger-width)\",\n default: \"auto\",\n };\n\n return (\n <PopoverPrimitive.Root open={open} {...props}>\n <PopoverPrimitive.Trigger\n className=\"hawa-w-full\"\n disabled={disableTrigger}\n {...triggerProps}\n >\n {trigger}\n </PopoverPrimitive.Trigger>\n <PopoverContent\n side={side}\n className={className}\n align={align}\n sideOffset={sideOffset}\n style={{\n width: widthStyles[width],\n maxWidth: \"var(--radix-popover-content-available-width)\",\n maxHeight: \"var(--radix-popover-content-available-height)\",\n }}\n {...contentProps}\n >\n {children}\n </PopoverContent>\n </PopoverPrimitive.Root>\n );\n};\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\nconst PopoverPortal = PopoverPrimitive.Portal;\nconst PopoverRoot = PopoverPrimitive.Root;\n\nexport { Popover, PopoverPortal, PopoverRoot, PopoverContent, PopoverTrigger };\n"],"mappings":";;;AAAA,OAAOA,UAAS,UAAc,QAAQ,WAAW,cAAAC,mBAAkB;AAGnE,SAAS,UAAU,aAAa,YAAY;;;ACH5C,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,OAAO,WAAW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AA,IAEN;AAAA,EACF;AACF;","names":["React","forwardRef","React","React","React","React","forwardRef","React","_a"]}
@@ -353,6 +353,7 @@ var Select = ({
353
353
  options: props.options,
354
354
  getOptionLabel: props.getOptionLabel,
355
355
  defaultValue: props.defaultValue,
356
+ value: props.value,
356
357
  placeholder: props.placeholder,
357
358
  isDisabled: props.disabled,
358
359
  isClearable: props.isClearable,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/select/index.ts","../../elements/select/Select.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Select\";","import React, { FC } from \"react\";\nimport ReactSelect, { MenuProps, OptionProps } from \"react-select\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { cn } from \"@util/index\";\nimport clsx from \"clsx\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ControlTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\n// The options container\ntype MenuTypes = MenuProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n};\n\n// The single options\ntype OptionTypes = OptionProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n isFocused: boolean;\n isSelected: boolean;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\nexport type SelectOptionProps = {\n value: any;\n label: any;\n};\n\ntype SelectTypes = {\n label?: string;\n hideHelperText?: boolean;\n options: SelectOptionProps[];\n labelKey?: string;\n isCreatable?: boolean;\n isClearable?: boolean;\n isMulti?: boolean;\n isSearchable?: boolean;\n controlClassNames?: string;\n containerClassNames?: string;\n onChange: any;\n helperText?: any;\n onInputChange?: any;\n native?: any;\n width?: \"full\" | \"small\" | \"fit\";\n value?: any;\n children?: any;\n getOptionLabel?: any;\n disabled?: boolean;\n defaultValue?: any;\n handleCreateOption?: () => void;\n placeholder?: string;\n hideIndicator?: boolean;\n phoneCode?: boolean;\n isLoading?: any;\n labelProps?: LabelProps;\n texts?: {\n noOptions?: string;\n createLabel?: string;\n };\n};\n\nexport const Select: FC<SelectTypes> = ({\n labelProps,\n labelKey = \"label\",\n ...props\n}) => {\n const NoOption = () => {\n return <div>{props.texts?.noOptions ?? \"No Items Found\"}</div>;\n };\n const Control: FC<ControlTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={clsx(\n \"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Option: FC<OptionTypes> = ({\n children,\n innerProps,\n innerRef,\n isFocused,\n isSelected,\n }) => {\n return (\n <div\n ref={innerRef}\n className={cn(\n \"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all\",\n isFocused\n ? \"hawa-bg-accent hawa-text-bg-accent-foreground\"\n : \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n isSelected && \"hawa-bg-primary hawa-text-primary-foreground\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Menu: FC<MenuTypes> = ({\n cx,\n children,\n getStyles,\n innerProps,\n innerRef,\n ...menuProps\n }) => {\n const menuOpen = menuProps.selectProps.menuIsOpen;\n return (\n <div\n className={cn(\n \"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md\",\n props.phoneCode ? \"hawa-p-1.5\" : \"hawa-w-full hawa-p-1.5\",\n menuOpen && \"hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95\",\n )}\n ref={innerRef}\n {...innerProps}\n // {...props}\n >\n {children}\n </div>\n );\n };\n\n let phoneCodeStyles =\n \"hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]\";\n let selectContainerStyles =\n \"hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm\";\n let selectPlaceholderStyles =\n \"hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1\";\n let selectIndicatorContainerStyles =\n \"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] \";\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {props.isLoading ? (\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n ) : !props.isCreatable ? (\n // TODO: enable keyboard to go to the next item in the list\n <ReactSelect\n noOptionsMessage={NoOption}\n classNames={{\n control: () =>\n cn(\n props.phoneCode && \"hawa-rounded-r-none\",\n props.controlClassNames,\n ),\n container: () =>\n cn(\n selectContainerStyles,\n props.phoneCode && phoneCodeStyles,\n\n props.isMulti && \"hawa-ps-0 \",\n ),\n placeholder: () =>\n cn(\n selectPlaceholderStyles,\n props.disabled && \"hawa-text-muted-foreground\",\n ),\n valueContainer: () => \"hawa-text-foreground hawa-px-1 \",\n singleValue: () =>\n cn(\n props.disabled\n ? \"hawa-text-muted-foreground hawa-opacity-30\"\n : \"hawa-text-foreground\",\n ),\n indicatorsContainer: () =>\n cn(\n selectIndicatorContainerStyles,\n props.hideIndicator ? \"hawa-invisible\" : \"hawa-px-1\",\n props.disabled && \"hawa-opacity-30\",\n ),\n }}\n unstyled\n autoFocus={false}\n components={\n props.hideIndicator\n ? { Option, Menu, IndicatorsContainer: () => null }\n : {\n Option,\n Menu,\n ValueContainer: (e) => (\n <div\n className={cn(\n e.className,\n \"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1\",\n )}\n {...e}\n />\n ),\n MultiValueContainer: (e) => (\n <div\n className=\"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row\"\n {...e}\n />\n ),\n }\n }\n onChange={(newValue: any, action) => props.onChange(newValue, action)}\n options={props.options}\n getOptionLabel={props.getOptionLabel}\n defaultValue={props.defaultValue}\n placeholder={props.placeholder}\n isDisabled={props.disabled}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n />\n ) : (\n <CreatableSelect\n formatCreateLabel={(inputValue) =>\n `${props.texts?.createLabel ?? \"Create\"} \"${inputValue}\"`\n }\n classNames={{\n container: () =>\n cn(\n \"hawa-rounded\",\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n ),\n placeholder: () => \"hawa-px-2 hawa-text-muted-foreground\",\n input: () => \"hawa-text-primary hawa-px-2\",\n valueContainer: () =>\n \"hawa-text-white dark:hawa-text-muted-foreground\",\n singleValue: () => \"hawa-text-black dark:hawa-text-white hawa-px-2\",\n indicatorsContainer: () =>\n \" hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground\",\n }}\n unstyled\n options={props.options}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n placeholder={props.placeholder}\n onCreateOption={props.handleCreateOption}\n onChange={(newValue, action) => props.onChange(newValue, action)}\n components={{ Control, Option, Menu }}\n onInputChange={(newValue, action) =>\n props.onInputChange(newValue, action)\n }\n />\n )}\n {!props.hideHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA0B;AAC1B,0BAAoD;AACpD,uBAA4B;;;ACF5B,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAAC,eAAiB;;;AELjB,mBAAkB;AAIX,IAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAGE,6BAAAC,QAAA;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;AChBF,IAAAC,SAAuB;;;ACAvB,IAAAC,gBAAkB;AAElB,uBAAkC;AAKlC,IAAM,iBAAiB,cAAAC,QAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,8BAAAA,QAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,gBAAgB,SAAS;AAAA,QACzB,gBAAgB,SAAS;AAAA,MAC3B;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;AAEtD,IAAM,eAAe,cAAAA,QAAM,WAGzB,CAAC,EAAE,WA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AA,QACC,mBAAmB,CAAC,eAAY;AA/O1C;AAgPY,qBAAG,iBAAM,UAAN,mBAAa,gBAAb,YAA4B,QAAQ,KAAK,UAAU;AAAA;AAAA,QAExD,YAAY;AAAA,UACV,WAAW,MACT;AAAA,YACE;AAAA,YACA,MAAM,WACF,4BACA;AAAA,UACN;AAAA,UACF,aAAa,MAAM;AAAA,UACnB,OAAO,MAAM;AAAA,UACb,gBAAgB,MACd;AAAA,UACF,aAAa,MAAM;AAAA,UACnB,qBAAqB,MACnB;AAAA,QACJ;AAAA,QACA,UAAQ;AAAA,QACR,SAAS,MAAM;AAAA,QACf,aAAa,MAAM;AAAA,QACnB,SAAS,MAAM;AAAA,QACf,cAAc,MAAM;AAAA,QACpB,aAAa,MAAM;AAAA,QACnB,gBAAgB,MAAM;AAAA,QACtB,UAAU,CAAC,UAAU,WAAW,MAAM,SAAS,UAAU,MAAM;AAAA,QAC/D,YAAY,EAAE,SAAS,QAAQ,KAAK;AAAA,QACpC,eAAe,CAAC,UAAU,WACxB,MAAM,cAAc,UAAU,MAAM;AAAA;AAAA,IAExC;AAAA,IAED,CAAC,MAAM,kBAAkB,8BAAAH,QAAA,cAAC,cAAW,YAAY,MAAM,YAAY;AAAA,EACtE;AAEJ;","names":["import_react","import_clsx","React","React","import_react","React","import_react","React","React","clsx","ReactSelect","CreatableSelect"]}
1
+ {"version":3,"sources":["../../elements/select/index.ts","../../elements/select/Select.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Select\";","import React, { FC } from \"react\";\nimport ReactSelect, { MenuProps, OptionProps } from \"react-select\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { cn } from \"@util/index\";\nimport clsx from \"clsx\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ControlTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\n// The options container\ntype MenuTypes = MenuProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n};\n\n// The single options\ntype OptionTypes = OptionProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n isFocused: boolean;\n isSelected: boolean;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\nexport type SelectOptionProps = {\n value: any;\n label: any;\n};\n\ntype SelectTypes = {\n label?: string;\n hideHelperText?: boolean;\n options: SelectOptionProps[];\n labelKey?: string;\n isCreatable?: boolean;\n isClearable?: boolean;\n isMulti?: boolean;\n isSearchable?: boolean;\n controlClassNames?: string;\n containerClassNames?: string;\n onChange: any;\n helperText?: any;\n onInputChange?: any;\n native?: any;\n width?: \"full\" | \"small\" | \"fit\";\n value?: any;\n children?: any;\n getOptionLabel?: any;\n disabled?: boolean;\n defaultValue?: any;\n handleCreateOption?: () => void;\n placeholder?: string;\n hideIndicator?: boolean;\n phoneCode?: boolean;\n isLoading?: any;\n labelProps?: LabelProps;\n texts?: {\n noOptions?: string;\n createLabel?: string;\n };\n};\n\nexport const Select: FC<SelectTypes> = ({\n labelProps,\n labelKey = \"label\",\n ...props\n}) => {\n const NoOption = () => {\n return <div>{props.texts?.noOptions ?? \"No Items Found\"}</div>;\n };\n const Control: FC<ControlTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={clsx(\n \"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Option: FC<OptionTypes> = ({\n children,\n innerProps,\n innerRef,\n isFocused,\n isSelected,\n }) => {\n return (\n <div\n ref={innerRef}\n className={cn(\n \"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all\",\n isFocused\n ? \"hawa-bg-accent hawa-text-bg-accent-foreground\"\n : \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n isSelected && \"hawa-bg-primary hawa-text-primary-foreground\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Menu: FC<MenuTypes> = ({\n cx,\n children,\n getStyles,\n innerProps,\n innerRef,\n ...menuProps\n }) => {\n const menuOpen = menuProps.selectProps.menuIsOpen;\n return (\n <div\n className={cn(\n \"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md\",\n props.phoneCode ? \"hawa-p-1.5\" : \"hawa-w-full hawa-p-1.5\",\n menuOpen && \"hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95\",\n )}\n ref={innerRef}\n {...innerProps}\n // {...props}\n >\n {children}\n </div>\n );\n };\n\n let phoneCodeStyles =\n \"hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]\";\n let selectContainerStyles =\n \"hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm\";\n let selectPlaceholderStyles =\n \"hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1\";\n let selectIndicatorContainerStyles =\n \"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] \";\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {props.isLoading ? (\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n ) : !props.isCreatable ? (\n // TODO: enable keyboard to go to the next item in the list\n <ReactSelect\n noOptionsMessage={NoOption}\n classNames={{\n control: () =>\n cn(\n props.phoneCode && \"hawa-rounded-r-none\",\n props.controlClassNames,\n ),\n container: () =>\n cn(\n selectContainerStyles,\n props.phoneCode && phoneCodeStyles,\n\n props.isMulti && \"hawa-ps-0 \",\n ),\n placeholder: () =>\n cn(\n selectPlaceholderStyles,\n props.disabled && \"hawa-text-muted-foreground\",\n ),\n valueContainer: () => \"hawa-text-foreground hawa-px-1 \",\n singleValue: () =>\n cn(\n props.disabled\n ? \"hawa-text-muted-foreground hawa-opacity-30\"\n : \"hawa-text-foreground\",\n ),\n indicatorsContainer: () =>\n cn(\n selectIndicatorContainerStyles,\n props.hideIndicator ? \"hawa-invisible\" : \"hawa-px-1\",\n props.disabled && \"hawa-opacity-30\",\n ),\n }}\n unstyled\n autoFocus={false}\n components={\n props.hideIndicator\n ? { Option, Menu, IndicatorsContainer: () => null }\n : {\n Option,\n Menu,\n ValueContainer: (e) => (\n <div\n className={cn(\n e.className,\n \"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1\",\n )}\n {...e}\n />\n ),\n MultiValueContainer: (e) => (\n <div\n className=\"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row\"\n {...e}\n />\n ),\n }\n }\n onChange={(newValue: any, action) => props.onChange(newValue, action)}\n options={props.options}\n getOptionLabel={props.getOptionLabel}\n defaultValue={props.defaultValue}\n value={props.value}\n placeholder={props.placeholder}\n isDisabled={props.disabled}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n />\n ) : (\n <CreatableSelect\n formatCreateLabel={(inputValue) =>\n `${props.texts?.createLabel ?? \"Create\"} \"${inputValue}\"`\n }\n classNames={{\n container: () =>\n cn(\n \"hawa-rounded\",\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n ),\n placeholder: () => \"hawa-px-2 hawa-text-muted-foreground\",\n input: () => \"hawa-text-primary hawa-px-2\",\n valueContainer: () =>\n \"hawa-text-white dark:hawa-text-muted-foreground\",\n singleValue: () => \"hawa-text-black dark:hawa-text-white hawa-px-2\",\n indicatorsContainer: () =>\n \" hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground\",\n }}\n unstyled\n options={props.options}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n placeholder={props.placeholder}\n onCreateOption={props.handleCreateOption}\n onChange={(newValue, action) => props.onChange(newValue, action)}\n components={{ Control, Option, Menu }}\n onInputChange={(newValue, action) =>\n props.onInputChange(newValue, action)\n }\n />\n )}\n {!props.hideHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA0B;AAC1B,0BAAoD;AACpD,uBAA4B;;;ACF5B,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAAC,eAAiB;;;AELjB,mBAAkB;AAIX,IAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAGE,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e,CAAC,UAAU,WACxB,MAAM,cAAc,UAAU,MAAM;AAAA;AAAA,IAExC;AAAA,IAED,CAAC,MAAM,kBAAkB,8BAAAH,QAAA,cAAC,cAAW,YAAY,MAAM,YAAY;AAAA,EACtE;AAEJ;","names":["import_react","import_clsx","React","React","import_react","React","import_react","React","React","clsx","ReactSelect","CreatableSelect"]}
@@ -318,6 +318,7 @@ var Select = ({
318
318
  options: props.options,
319
319
  getOptionLabel: props.getOptionLabel,
320
320
  defaultValue: props.defaultValue,
321
+ value: props.value,
321
322
  placeholder: props.placeholder,
322
323
  isDisabled: props.disabled,
323
324
  isClearable: props.isClearable,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/select/Select.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport ReactSelect, { MenuProps, OptionProps } from \"react-select\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { cn } from \"@util/index\";\nimport clsx from \"clsx\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ControlTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\n// The options container\ntype MenuTypes = MenuProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n};\n\n// The single options\ntype OptionTypes = OptionProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n isFocused: boolean;\n isSelected: boolean;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\nexport type SelectOptionProps = {\n value: any;\n label: any;\n};\n\ntype SelectTypes = {\n label?: string;\n hideHelperText?: boolean;\n options: SelectOptionProps[];\n labelKey?: string;\n isCreatable?: boolean;\n isClearable?: boolean;\n isMulti?: boolean;\n isSearchable?: boolean;\n controlClassNames?: string;\n containerClassNames?: string;\n onChange: any;\n helperText?: any;\n onInputChange?: any;\n native?: any;\n width?: \"full\" | \"small\" | \"fit\";\n value?: any;\n children?: any;\n getOptionLabel?: any;\n disabled?: boolean;\n defaultValue?: any;\n handleCreateOption?: () => void;\n placeholder?: string;\n hideIndicator?: boolean;\n phoneCode?: boolean;\n isLoading?: any;\n labelProps?: LabelProps;\n texts?: {\n noOptions?: string;\n createLabel?: string;\n };\n};\n\nexport const Select: FC<SelectTypes> = ({\n labelProps,\n labelKey = \"label\",\n ...props\n}) => {\n const NoOption = () => {\n return <div>{props.texts?.noOptions ?? \"No Items Found\"}</div>;\n };\n const Control: FC<ControlTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={clsx(\n \"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Option: FC<OptionTypes> = ({\n children,\n innerProps,\n innerRef,\n isFocused,\n isSelected,\n }) => {\n return (\n <div\n ref={innerRef}\n className={cn(\n \"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all\",\n isFocused\n ? \"hawa-bg-accent hawa-text-bg-accent-foreground\"\n : \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n isSelected && \"hawa-bg-primary hawa-text-primary-foreground\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Menu: FC<MenuTypes> = ({\n cx,\n children,\n getStyles,\n innerProps,\n innerRef,\n ...menuProps\n }) => {\n const menuOpen = menuProps.selectProps.menuIsOpen;\n return (\n <div\n className={cn(\n \"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md\",\n props.phoneCode ? \"hawa-p-1.5\" : \"hawa-w-full hawa-p-1.5\",\n menuOpen && \"hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95\",\n )}\n ref={innerRef}\n {...innerProps}\n // {...props}\n >\n {children}\n </div>\n );\n };\n\n let phoneCodeStyles =\n \"hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]\";\n let selectContainerStyles =\n \"hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm\";\n let selectPlaceholderStyles =\n \"hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1\";\n let selectIndicatorContainerStyles =\n \"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] \";\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {props.isLoading ? (\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n ) : !props.isCreatable ? (\n // TODO: enable keyboard to go to the next item in the list\n <ReactSelect\n noOptionsMessage={NoOption}\n classNames={{\n control: () =>\n cn(\n props.phoneCode && \"hawa-rounded-r-none\",\n props.controlClassNames,\n ),\n container: () =>\n cn(\n selectContainerStyles,\n props.phoneCode && phoneCodeStyles,\n\n props.isMulti && \"hawa-ps-0 \",\n ),\n placeholder: () =>\n cn(\n selectPlaceholderStyles,\n props.disabled && \"hawa-text-muted-foreground\",\n ),\n valueContainer: () => \"hawa-text-foreground hawa-px-1 \",\n singleValue: () =>\n cn(\n props.disabled\n ? \"hawa-text-muted-foreground hawa-opacity-30\"\n : \"hawa-text-foreground\",\n ),\n indicatorsContainer: () =>\n cn(\n selectIndicatorContainerStyles,\n props.hideIndicator ? \"hawa-invisible\" : \"hawa-px-1\",\n props.disabled && \"hawa-opacity-30\",\n ),\n }}\n unstyled\n autoFocus={false}\n components={\n props.hideIndicator\n ? { Option, Menu, IndicatorsContainer: () => null }\n : {\n Option,\n Menu,\n ValueContainer: (e) => (\n <div\n className={cn(\n e.className,\n \"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1\",\n )}\n {...e}\n />\n ),\n MultiValueContainer: (e) => (\n <div\n className=\"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row\"\n {...e}\n />\n ),\n }\n }\n onChange={(newValue: any, action) => props.onChange(newValue, action)}\n options={props.options}\n getOptionLabel={props.getOptionLabel}\n defaultValue={props.defaultValue}\n placeholder={props.placeholder}\n isDisabled={props.disabled}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n />\n ) : (\n <CreatableSelect\n formatCreateLabel={(inputValue) =>\n `${props.texts?.createLabel ?? \"Create\"} \"${inputValue}\"`\n }\n classNames={{\n container: () =>\n cn(\n \"hawa-rounded\",\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n ),\n placeholder: () => \"hawa-px-2 hawa-text-muted-foreground\",\n input: () => \"hawa-text-primary hawa-px-2\",\n valueContainer: () =>\n \"hawa-text-white dark:hawa-text-muted-foreground\",\n singleValue: () => \"hawa-text-black dark:hawa-text-white hawa-px-2\",\n indicatorsContainer: () =>\n \" hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground\",\n }}\n unstyled\n options={props.options}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n placeholder={props.placeholder}\n onCreateOption={props.handleCreateOption}\n onChange={(newValue, action) => props.onChange(newValue, action)}\n components={{ Control, Option, Menu }}\n onInputChange={(newValue, action) =>\n props.onInputChange(newValue, action)\n }\n />\n )}\n {!props.hideHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;AAAA,OAAOA,YAAmB;AAC1B,OAAO,iBAA6C;AACpD,OAAO,qBAAqB;;;ACF5B,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADAA,OAAOC,WAAU;;;AELjB,OAAO,WAAW;AAIX,IAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAGE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;AChBF,YAAYC,YAAW;;;ACAvB,OAAOC,YAAW;AAElB,YAAY,sBAAsB;AAKlC,IAAM,iBAAiBC,OAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,gBAAAA,OAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,gBAAgB,SAAS;AAAA,QACzB,gBAAgB,SAAS;AAAA,MAC3B;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B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AAAA,MAAC;AAAA;AAAA,QACC,mBAAmB,CAAC,eAAY;AA/O1C;AAgPY,qBAAG,iBAAM,UAAN,mBAAa,gBAAb,YAA4B,QAAQ,KAAK,UAAU;AAAA;AAAA,QAExD,YAAY;AAAA,UACV,WAAW,MACT;AAAA,YACE;AAAA,YACA,MAAM,WACF,4BACA;AAAA,UACN;AAAA,UACF,aAAa,MAAM;AAAA,UACnB,OAAO,MAAM;AAAA,UACb,gBAAgB,MACd;AAAA,UACF,aAAa,MAAM;AAAA,UACnB,qBAAqB,MACnB;AAAA,QACJ;AAAA,QACA,UAAQ;AAAA,QACR,SAAS,MAAM;AAAA,QACf,aAAa,MAAM;AAAA,QACnB,SAAS,MAAM;AAAA,QACf,cAAc,MAAM;AAAA,QACpB,aAAa,MAAM;AAAA,QACnB,gBAAgB,MAAM;AAAA,QACtB,UAAU,CAAC,UAAU,WAAW,MAAM,SAAS,UAAU,MAAM;AAAA,QAC/D,YAAY,EAAE,SAAS,QAAQ,KAAK;AAAA,QACpC,eAAe,CAAC,UAAU,WACxB,MAAM,cAAc,UAAU,MAAM;AAAA;AAAA,IAExC;AAAA,IAED,CAAC,MAAM,kBAAkB,gBAAAA,OAAA,cAAC,cAAW,YAAY,MAAM,YAAY;AAAA,EACtE;AAEJ;","names":["React","clsx","React","React","React","React","React","React","clsx"]}
1
+ {"version":3,"sources":["../../elements/select/Select.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport ReactSelect, { MenuProps, OptionProps } from \"react-select\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { cn } from \"@util/index\";\nimport clsx from \"clsx\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ControlTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\n// The options container\ntype MenuTypes = MenuProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n};\n\n// The single options\ntype OptionTypes = OptionProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n isFocused: boolean;\n isSelected: boolean;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\nexport type SelectOptionProps = {\n value: any;\n label: any;\n};\n\ntype SelectTypes = {\n label?: string;\n hideHelperText?: boolean;\n options: SelectOptionProps[];\n labelKey?: string;\n isCreatable?: boolean;\n isClearable?: boolean;\n isMulti?: boolean;\n isSearchable?: boolean;\n controlClassNames?: string;\n containerClassNames?: string;\n onChange: any;\n helperText?: any;\n onInputChange?: any;\n native?: any;\n width?: \"full\" | \"small\" | \"fit\";\n value?: any;\n children?: any;\n getOptionLabel?: any;\n disabled?: boolean;\n defaultValue?: any;\n handleCreateOption?: () => void;\n placeholder?: string;\n hideIndicator?: boolean;\n phoneCode?: boolean;\n isLoading?: any;\n labelProps?: LabelProps;\n texts?: {\n noOptions?: string;\n createLabel?: string;\n };\n};\n\nexport const Select: FC<SelectTypes> = ({\n labelProps,\n labelKey = \"label\",\n ...props\n}) => {\n const NoOption = () => {\n return <div>{props.texts?.noOptions ?? \"No Items Found\"}</div>;\n };\n const Control: FC<ControlTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={clsx(\n \"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Option: FC<OptionTypes> = ({\n children,\n innerProps,\n innerRef,\n isFocused,\n isSelected,\n }) => {\n return (\n <div\n ref={innerRef}\n className={cn(\n \"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all\",\n isFocused\n ? \"hawa-bg-accent hawa-text-bg-accent-foreground\"\n : \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n isSelected && \"hawa-bg-primary hawa-text-primary-foreground\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Menu: FC<MenuTypes> = ({\n cx,\n children,\n getStyles,\n innerProps,\n innerRef,\n ...menuProps\n }) => {\n const menuOpen = menuProps.selectProps.menuIsOpen;\n return (\n <div\n className={cn(\n \"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md\",\n props.phoneCode ? \"hawa-p-1.5\" : \"hawa-w-full hawa-p-1.5\",\n menuOpen && \"hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95\",\n )}\n ref={innerRef}\n {...innerProps}\n // {...props}\n >\n {children}\n </div>\n );\n };\n\n let phoneCodeStyles =\n \"hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]\";\n let selectContainerStyles =\n \"hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm\";\n let selectPlaceholderStyles =\n \"hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1\";\n let selectIndicatorContainerStyles =\n \"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] \";\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {props.isLoading ? (\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n ) : !props.isCreatable ? (\n // TODO: enable keyboard to go to the next item in the list\n <ReactSelect\n noOptionsMessage={NoOption}\n classNames={{\n control: () =>\n cn(\n props.phoneCode && \"hawa-rounded-r-none\",\n props.controlClassNames,\n ),\n container: () =>\n cn(\n selectContainerStyles,\n props.phoneCode && phoneCodeStyles,\n\n props.isMulti && \"hawa-ps-0 \",\n ),\n placeholder: () =>\n cn(\n selectPlaceholderStyles,\n props.disabled && \"hawa-text-muted-foreground\",\n ),\n valueContainer: () => \"hawa-text-foreground hawa-px-1 \",\n singleValue: () =>\n cn(\n props.disabled\n ? \"hawa-text-muted-foreground hawa-opacity-30\"\n : \"hawa-text-foreground\",\n ),\n indicatorsContainer: () =>\n cn(\n selectIndicatorContainerStyles,\n props.hideIndicator ? \"hawa-invisible\" : \"hawa-px-1\",\n props.disabled && \"hawa-opacity-30\",\n ),\n }}\n unstyled\n autoFocus={false}\n components={\n props.hideIndicator\n ? { Option, Menu, IndicatorsContainer: () => null }\n : {\n Option,\n Menu,\n ValueContainer: (e) => (\n <div\n className={cn(\n e.className,\n \"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1\",\n )}\n {...e}\n />\n ),\n MultiValueContainer: (e) => (\n <div\n className=\"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row\"\n {...e}\n />\n ),\n }\n }\n onChange={(newValue: any, action) => props.onChange(newValue, action)}\n options={props.options}\n getOptionLabel={props.getOptionLabel}\n defaultValue={props.defaultValue}\n value={props.value}\n placeholder={props.placeholder}\n isDisabled={props.disabled}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n />\n ) : (\n <CreatableSelect\n formatCreateLabel={(inputValue) =>\n `${props.texts?.createLabel ?? \"Create\"} \"${inputValue}\"`\n }\n classNames={{\n container: () =>\n cn(\n \"hawa-rounded\",\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n ),\n placeholder: () => \"hawa-px-2 hawa-text-muted-foreground\",\n input: () => \"hawa-text-primary hawa-px-2\",\n valueContainer: () =>\n \"hawa-text-white dark:hawa-text-muted-foreground\",\n singleValue: () => \"hawa-text-black dark:hawa-text-white hawa-px-2\",\n indicatorsContainer: () =>\n \" hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground\",\n }}\n unstyled\n options={props.options}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n placeholder={props.placeholder}\n onCreateOption={props.handleCreateOption}\n onChange={(newValue, action) => props.onChange(newValue, action)}\n components={{ Control, Option, Menu }}\n onInputChange={(newValue, action) =>\n props.onInputChange(newValue, action)\n }\n />\n )}\n {!props.hideHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;AAAA,OAAOA,YAAmB;AAC1B,OAAO,iBAA6C;AACpD,OAAO,qBAAqB;;;ACF5B,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADAA,OAAOC,WAAU;;;AELjB,OAAO,WAAW;AAIX,IAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAGE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;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ACtE;AAEJ;","names":["React","clsx","React","React","React","React","React","React","clsx"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.45.0-next",
3
+ "version": "0.46.0-next",
4
4
  "description": "Modern UI Kit made with Tailwind",
5
5
  "author": {
6
6
  "name": "Sikka Software",
@@ -77,7 +77,7 @@
77
77
  "libphonenumber-js": "^1.11.5",
78
78
  "prism-react-renderer": "^2.3.1",
79
79
  "prismjs": "^1.29.0",
80
- "react-day-picker": "^9.0.7",
80
+ "react-day-picker": "^9.0.8",
81
81
  "react-dropzone": "^14.2.3",
82
82
  "react-headless-pagination": "^1.1.6",
83
83
  "react-hook-form": "^7.52.2",
@@ -98,15 +98,15 @@
98
98
  "@types/react": "^18.3.3",
99
99
  "@types/react-dom": "^18.3.0",
100
100
  "autoprefixer": "^10.4.20",
101
- "boxen": "^8.0.0",
101
+ "boxen": "^8.0.1",
102
102
  "chalk": "^5.3.0",
103
103
  "embla-carousel": "8.1.8",
104
104
  "jest": "^29.7.0",
105
- "lucide-react": "^0.424.0",
106
- "postcss": "^8.4.40",
105
+ "lucide-react": "^0.427.0",
106
+ "postcss": "^8.4.41",
107
107
  "postcss-cli": "^11.0.0",
108
108
  "postcss-import": "^16.1.0",
109
- "tailwindcss": "^3.4.7",
109
+ "tailwindcss": "^3.4.9",
110
110
  "tailwindcss-animate": "^1.0.7",
111
111
  "tsconfig-paths-webpack-plugin": "^4.1.0",
112
112
  "tsup": "^8.2.4"