@sikka/hawa 0.34.8-next → 0.35.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 (129) hide show
  1. package/dist/{Radio-BpXOu4Hr.d.mts → Radio-BCD7k628.d.mts} +3 -0
  2. package/dist/{Radio-CREjhlGz.d.ts → Radio-y9uhxitu.d.ts} +3 -0
  3. package/dist/alert/index.js +28 -17
  4. package/dist/alert/index.js.map +1 -1
  5. package/dist/alert/index.mjs +61 -50
  6. package/dist/alert/index.mjs.map +1 -1
  7. package/dist/appLayout/index.js +81 -70
  8. package/dist/appLayout/index.js.map +1 -1
  9. package/dist/appLayout/index.mjs +138 -127
  10. package/dist/appLayout/index.mjs.map +1 -1
  11. package/dist/backToTop/index.js +28 -17
  12. package/dist/backToTop/index.js.map +1 -1
  13. package/dist/backToTop/index.mjs +55 -44
  14. package/dist/backToTop/index.mjs.map +1 -1
  15. package/dist/blocks/auth/index.js +50 -39
  16. package/dist/blocks/auth/index.mjs +5 -5
  17. package/dist/blocks/feedback/index.d.mts +3 -0
  18. package/dist/blocks/feedback/index.d.ts +3 -0
  19. package/dist/blocks/feedback/index.js +174 -120
  20. package/dist/blocks/feedback/index.mjs +29 -93
  21. package/dist/blocks/index.d.mts +2 -1
  22. package/dist/blocks/index.d.ts +2 -1
  23. package/dist/blocks/index.js +253 -201
  24. package/dist/blocks/index.mjs +3 -3
  25. package/dist/blocks/misc/index.js +71 -60
  26. package/dist/blocks/misc/index.mjs +5 -5
  27. package/dist/blocks/pricing/index.js +154 -80
  28. package/dist/blocks/pricing/index.mjs +4 -4
  29. package/dist/button/index.d.mts +13 -0
  30. package/dist/button/index.d.ts +13 -0
  31. package/dist/button/index.js +28 -17
  32. package/dist/button/index.js.map +1 -1
  33. package/dist/button/index.mjs +51 -40
  34. package/dist/button/index.mjs.map +1 -1
  35. package/dist/calendar/index.js +34 -23
  36. package/dist/calendar/index.js.map +1 -1
  37. package/dist/calendar/index.mjs +57 -46
  38. package/dist/calendar/index.mjs.map +1 -1
  39. package/dist/{chunk-GEB3LM5A.mjs → chunk-A376BKNX.mjs} +2 -2
  40. package/dist/{chunk-OS2UOK5C.mjs → chunk-DABX3SU6.mjs} +64 -51
  41. package/dist/{chunk-QPZ4ZR2B.mjs → chunk-DFWFQWWT.mjs} +155 -116
  42. package/dist/{chunk-UBNCETCU.mjs → chunk-GVZWOUGN.mjs} +1 -1
  43. package/dist/chunk-HHC34DXN.mjs +320 -0
  44. package/dist/{chunk-QVF3VLB7.mjs → chunk-IDKXEJET.mjs} +157 -144
  45. package/dist/{chunk-AW5FW5TY.mjs → chunk-L56XQRQI.mjs} +1 -1
  46. package/dist/{chunk-ORNLFAC6.mjs → chunk-XFRJ62W3.mjs} +1 -1
  47. package/dist/{chunk-RTGD7N7I.mjs → chunk-XJMDUR5A.mjs} +1 -1
  48. package/dist/{chunk-J7BT4XJR.mjs → chunk-YOT2GVXO.mjs} +1 -1
  49. package/dist/codeBlock/index.js +28 -17
  50. package/dist/codeBlock/index.js.map +1 -1
  51. package/dist/codeBlock/index.mjs +70 -59
  52. package/dist/codeBlock/index.mjs.map +1 -1
  53. package/dist/colorPicker/index.js.map +1 -1
  54. package/dist/colorPicker/index.mjs.map +1 -1
  55. package/dist/combobox/index.js.map +1 -1
  56. package/dist/combobox/index.mjs.map +1 -1
  57. package/dist/dataTable/index.d.mts +1 -2
  58. package/dist/dataTable/index.d.ts +1 -2
  59. package/dist/dataTable/index.js +144 -105
  60. package/dist/dataTable/index.js.map +1 -1
  61. package/dist/dataTable/index.mjs +178 -139
  62. package/dist/dataTable/index.mjs.map +1 -1
  63. package/dist/datePicker/index.d.mts +23 -5
  64. package/dist/datePicker/index.d.ts +23 -5
  65. package/dist/datePicker/index.js +46 -18
  66. package/dist/datePicker/index.js.map +1 -1
  67. package/dist/datePicker/index.mjs +46 -18
  68. package/dist/datePicker/index.mjs.map +1 -1
  69. package/dist/docsLayout/index.js +40 -29
  70. package/dist/docsLayout/index.js.map +1 -1
  71. package/dist/docsLayout/index.mjs +135 -124
  72. package/dist/docsLayout/index.mjs.map +1 -1
  73. package/dist/elements/index.d.mts +7 -3
  74. package/dist/elements/index.d.ts +7 -3
  75. package/dist/elements/index.js +475 -395
  76. package/dist/elements/index.mjs +32 -4
  77. package/dist/fileDropzone/index.js +28 -17
  78. package/dist/fileDropzone/index.js.map +1 -1
  79. package/dist/fileDropzone/index.mjs +89 -78
  80. package/dist/fileDropzone/index.mjs.map +1 -1
  81. package/dist/index.css +3 -0
  82. package/dist/index.d.mts +16 -9
  83. package/dist/index.d.ts +16 -9
  84. package/dist/index.js +515 -435
  85. package/dist/index.mjs +1204 -1124
  86. package/dist/input/index.js +1 -1
  87. package/dist/input/index.js.map +1 -1
  88. package/dist/input/index.mjs +1 -1
  89. package/dist/input/index.mjs.map +1 -1
  90. package/dist/interfaceSettings/index.js +85 -24
  91. package/dist/interfaceSettings/index.js.map +1 -1
  92. package/dist/interfaceSettings/index.mjs +107 -46
  93. package/dist/interfaceSettings/index.mjs.map +1 -1
  94. package/dist/layout/index.js +121 -110
  95. package/dist/layout/index.mjs +2 -2
  96. package/dist/passwordInput/index.js +1 -1
  97. package/dist/passwordInput/index.js.map +1 -1
  98. package/dist/passwordInput/index.mjs +1 -1
  99. package/dist/passwordInput/index.mjs.map +1 -1
  100. package/dist/phoneInput/index.js.map +1 -1
  101. package/dist/phoneInput/index.mjs.map +1 -1
  102. package/dist/radio/index.d.mts +3 -0
  103. package/dist/radio/index.d.ts +3 -0
  104. package/dist/radio/index.js +85 -24
  105. package/dist/radio/index.js.map +1 -1
  106. package/dist/radio/index.mjs +100 -39
  107. package/dist/radio/index.mjs.map +1 -1
  108. package/dist/select/index.js.map +1 -1
  109. package/dist/select/index.mjs.map +1 -1
  110. package/dist/simpleTable/index.js.map +1 -1
  111. package/dist/simpleTable/index.mjs.map +1 -1
  112. package/dist/skeleton/index.js.map +1 -1
  113. package/dist/skeleton/index.mjs.map +1 -1
  114. package/dist/sortButton/index.js +28 -17
  115. package/dist/sortButton/index.js.map +1 -1
  116. package/dist/sortButton/index.mjs +58 -47
  117. package/dist/sortButton/index.mjs.map +1 -1
  118. package/dist/splitButton/index.d.mts +12 -0
  119. package/dist/splitButton/index.d.ts +12 -0
  120. package/dist/splitButton/index.js +70 -59
  121. package/dist/splitButton/index.js.map +1 -1
  122. package/dist/splitButton/index.mjs +93 -82
  123. package/dist/splitButton/index.mjs.map +1 -1
  124. package/dist/stats/index.js.map +1 -1
  125. package/dist/stats/index.mjs.map +1 -1
  126. package/dist/textarea/index.js.map +1 -1
  127. package/dist/textarea/index.mjs.map +1 -1
  128. package/package.json +6 -6
  129. package/dist/chunk-IQEBXGLM.mjs +0 -215
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/textarea/Textarea.tsx","../../util/index.ts","../../elements/skeleton/Skeleton.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { Skeleton } from \"@elements/skeleton\";\n\nimport { Label, LabelProps } from \"../label\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n helperText?: string;\n isLoading?: boolean;\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n forceHideHelperText?: boolean;\n textareaProps?: React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n showCount?: boolean;\n countPosition?: \"top\" | \"bottom\";\n classNames?: {\n textarea?: string;\n };\n}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n className,\n classNames,\n labelProps,\n showCount,\n forceHideHelperText,\n textareaProps,\n countPosition = \"bottom\",\n isLoading,\n ...props\n },\n ref\n ) => {\n return (\n <div\n className={cn(\n \"textarea-main hawa-relative hawa-flex hawa-h-full hawa-w-full hawa-flex-col\",\n !forceHideHelperText && \"hawa-gap-2\",\n className\n )}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-justify-between\">\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {showCount && countPosition === \"top\" && (\n <div\n className={\n \"hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none\"\n }\n >\n {textareaProps?.value ? String(textareaProps?.value).length : 0}/\n {textareaProps?.maxLength}\n </div>\n )}\n </div>\n {isLoading ? (\n <Skeleton style={{ height: 40 }} />\n ) : (\n <textarea\n {...textareaProps}\n className={cn(\n \"hawa-flex hawa-min-h-[40px] hawa-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50\",\n classNames?.textarea\n )}\n ref={ref}\n />\n )}\n <div className=\"hawa-flex hawa-flex-row hawa-justify-between\">\n {/* Regular helper text */}\n {!forceHideHelperText && (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n props.helperText\n ? \"hawa-h-4 hawa-opacity-100\"\n : \"hawa-h-0 hawa-opacity-0\"\n )}\n >\n {props.helperText}\n </p>\n )}\n\n {/* Character Counter */}\n {showCount && countPosition === \"bottom\" && (\n <div className={\"hawa-text-start hawa-text-xs hawa-transition-all\"}>\n {textareaProps?.value ? String(textareaProps?.value).length : 0}/\n {textareaProps?.maxLength}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\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\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","import * as React from \"react\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault()\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\"\n },\n className\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\"\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n"],"mappings":";;;A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,aAAa,kBAAkB,YAC9B,qCAAC,SAAI,WAAW,uDACb,+CAAe,SAAQ,OAAO,+CAAe,KAAK,EAAE,SAAS,GAAE,KAC/D,+CAAe,SAClB,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["React","React","React","React"]}
1
+ {"version":3,"sources":["../../elements/textarea/Textarea.tsx","../../util/index.ts","../../elements/skeleton/Skeleton.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { Skeleton } from \"@elements/skeleton\";\n\nimport { Label, LabelProps } from \"../label\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n helperText?: string;\n isLoading?: boolean;\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n forceHideHelperText?: boolean;\n textareaProps?: React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n showCount?: boolean;\n countPosition?: \"top\" | \"bottom\";\n classNames?: {\n textarea?: string;\n };\n}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n className,\n classNames,\n labelProps,\n showCount,\n forceHideHelperText,\n textareaProps,\n countPosition = \"bottom\",\n isLoading,\n ...props\n },\n ref\n ) => {\n return (\n <div\n className={cn(\n \"textarea-main hawa-relative hawa-flex hawa-h-full hawa-w-full hawa-flex-col\",\n !forceHideHelperText && \"hawa-gap-2\",\n className\n )}\n >\n <div className=\"hawa-flex hawa-flex-row hawa-justify-between\">\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {showCount && countPosition === \"top\" && (\n <div\n className={\n \"hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none\"\n }\n >\n {textareaProps?.value ? String(textareaProps?.value).length : 0}/\n {textareaProps?.maxLength}\n </div>\n )}\n </div>\n {isLoading ? (\n <Skeleton style={{ height: 40 }} />\n ) : (\n <textarea\n {...textareaProps}\n className={cn(\n \"hawa-flex hawa-min-h-[40px] hawa-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50\",\n classNames?.textarea\n )}\n ref={ref}\n />\n )}\n <div className=\"hawa-flex hawa-flex-row hawa-justify-between\">\n {/* Regular helper text */}\n {!forceHideHelperText && (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n props.helperText\n ? \"hawa-h-4 hawa-opacity-100\"\n : \"hawa-h-0 hawa-opacity-0\"\n )}\n >\n {props.helperText}\n </p>\n )}\n\n {/* Character Counter */}\n {showCount && countPosition === \"bottom\" && (\n <div className={\"hawa-text-start hawa-text-xs hawa-transition-all\"}>\n {textareaProps?.value ? String(textareaProps?.value).length : 0}/\n {textareaProps?.maxLength}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\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\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","import * as React from \"react\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault()\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\"\n },\n className\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\"\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n"],"mappings":";;;AAAA,YAAYA,YAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,OAAO,WAAW;AAWlB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,QAAM,kBAAkB;A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AAA,EACvB,CACF;AACF,CAEJ,CACD;AAED,MAAM,cAAc;;;AHpCpB,IAAM,WAAiB;AAAA,EACrB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,CAAC,uBAAuB;AAAA,UACxB;AAAA,QACF;AAAA;AAAA,MAEA,qCAAC,SAAI,WAAU,kDACZ,MAAM,SAAS,qCAAC,SAAO,GAAG,cAAa,MAAM,KAAM,GACnD,aAAa,kBAAkB,SAC9B;AAAA,QAAC;AAAA;AAAA,UACC,WACE;AAAA;AAAA,SAGD,+CAAe,SAAQ,OAAO,+CAAe,KAAK,EAAE,SAAS;AAAA,QAAE;AAAA,QAC/D,+CAAe;AAAA,MAClB,CAEJ;AAAA,MACC,YACC,qCAAC,YAAS,OAAO,EAAE,QAAQ,GAAG,GAAG,IAEjC;AAAA,QAAC;AAAA;AAAA,UACA,GAAG;AAAA,UACF,WAAW;AAAA,YACT;AAAA,YACA,yCAAY;AAAA,UACd;AAAA,UACA;AAAA;AAAA,MACF;AAAA,MAEF,qCAAC,SAAI,WAAU,kDAEZ,CAAC,uBACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,MAAM,aACF,8BACA;AAAA,UACN;AAAA;AAAA,QAEC,MAAM;AAAA,MACT,GAID,aAAa,kBAAkB,YAC9B,qCAAC,SAAI,WAAW,uDACb,+CAAe,SAAQ,OAAO,+CAAe,KAAK,EAAE,SAAS,GAAE,KAC/D,+CAAe,SAClB,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["React","React","React","React"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.34.8-next",
3
+ "version": "0.35.0-next",
4
4
  "description": "Modern UI Kit made with Tailwind",
5
5
  "author": {
6
6
  "name": "Sikka Software",
@@ -69,9 +69,9 @@
69
69
  "clsx": "^2.1.1",
70
70
  "cmdk": "^1.0.0",
71
71
  "date-fns": "^3.6.0",
72
- "embla-carousel-auto-height": "^8.1.0",
73
- "embla-carousel-react": "^8.1.0",
74
- "eslint": "^9.2.0",
72
+ "embla-carousel-auto-height": "^8.1.1",
73
+ "embla-carousel-react": "^8.1.1",
74
+ "eslint": "^9.3.0",
75
75
  "eslint-config-next": "^14.2.3",
76
76
  "libphonenumber-js": "^1.11.1",
77
77
  "prism-react-renderer": "^2.3.1",
@@ -81,7 +81,7 @@
81
81
  "react-headless-pagination": "^1.1.5",
82
82
  "react-hook-form": "^7.51.4",
83
83
  "react-select": "^5.8.0",
84
- "signature_pad": "^5.0.0",
84
+ "signature_pad": "^5.0.1",
85
85
  "sonner": "^1.4.41",
86
86
  "tailwind-merge": "^2.3.0",
87
87
  "tailwind-variants": "^0.2.1",
@@ -99,7 +99,7 @@
99
99
  "autoprefixer": "^10.4.19",
100
100
  "boxen": "^7.1.1",
101
101
  "chalk": "^5.3.0",
102
- "embla-carousel": "8.1.0",
102
+ "embla-carousel": "8.1.1",
103
103
  "jest": "^29.7.0",
104
104
  "jest-environment-jsdom": "^29.7.0",
105
105
  "lucide-react": "^0.378.0",
@@ -1,215 +0,0 @@
1
- "use client";
2
- import {
3
- Label,
4
- cn
5
- } from "./chunk-OS2UOK5C.mjs";
6
-
7
- // elements/radio/Radio.tsx
8
- import React, { useState, useRef, useEffect, forwardRef } from "react";
9
- var Radio = forwardRef(
10
- ({
11
- design = "default",
12
- width = "default",
13
- size = "default",
14
- orientation = "horizontal",
15
- name,
16
- labelProps,
17
- tabsContainerClassName,
18
- forceHideHelperText = false,
19
- onChange,
20
- ...props
21
- }, ref) => {
22
- var _a, _b, _c;
23
- const [selectedOption, setSelectedOption] = useState(
24
- props.defaultValue || props.value
25
- );
26
- let activeTabStyle = "hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary";
27
- let inactiveTabStyle = `hawa-inline-block hawa-w-full hawa-transition-all hawa-bg-primary-foreground dark:hover:hawa-text-white
28
- ${props.disabled ? "" : "hover:hawa-bg-muted"}`;
29
- let orientationStyle = {
30
- horizontal: "hawa-flex hawa-flex-row",
31
- vertical: "hawa-flex hawa-flex-col"
32
- };
33
- let tabSizeStyle = {
34
- default: "hawa-py-2 hawa-px-4 hawa-text-sm",
35
- lg: "hawa-py-2 hawa-px-4",
36
- sm: "hawa-p-1.5 hawa-text-xs",
37
- xs: "hawa-p-1 hawa-text-[10px]"
38
- };
39
- let widthStyle = {
40
- none: "",
41
- default: "hawa-max-w-fit",
42
- full: "hawa-w-full"
43
- };
44
- const [parentDirection, setParentDirection] = React.useState(
45
- null
46
- );
47
- const parentRef = useRef(null);
48
- useEffect(() => {
49
- var _a2;
50
- const parentNode = (_a2 = parentRef.current) == null ? void 0 : _a2.parentNode;
51
- if (parentNode) {
52
- const dir = window.getComputedStyle(parentNode).direction;
53
- setParentDirection(dir);
54
- }
55
- });
56
- const handleChange = (opt) => {
57
- setSelectedOption(opt.value);
58
- if (onChange) {
59
- onChange(opt.value);
60
- } else {
61
- console.log("onChange was not provided");
62
- }
63
- };
64
- switch (design) {
65
- case "tabs":
66
- return /* @__PURE__ */ React.createElement("div", { className: "hawa-gap-2 hawa-flex hawa-flex-col" }, props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React.createElement(
67
- "ul",
68
- {
69
- ref: parentRef,
70
- className: cn(
71
- props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
72
- "hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium hawa-h-[40px]",
73
- orientationStyle[orientation],
74
- widthStyle[width],
75
- tabsContainerClassName
76
- )
77
- },
78
- (_b = props.options) == null ? void 0 : _b.map((opt, o) => /* @__PURE__ */ React.createElement(
79
- "li",
80
- {
81
- "aria-current": "page",
82
- onClick: () => {
83
- if (props.disabled)
84
- return;
85
- handleChange(opt);
86
- },
87
- className: cn(
88
- "hawa-w-full hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 ",
89
- !props.disabled && "hawa-cursor-pointer",
90
- orientation === "horizontal" && parentDirection === "ltr" && "hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r",
91
- orientation === "horizontal" && parentDirection === "rtl" && "hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l",
92
- orientation === "vertical" && "hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b",
93
- tabSizeStyle[size],
94
- selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
95
- ),
96
- key: o
97
- },
98
- opt.icon && opt.icon,
99
- opt.label
100
- ))
101
- ), !forceHideHelperText && /* @__PURE__ */ React.createElement(
102
- "p",
103
- {
104
- className: cn(
105
- "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
106
- props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
107
- )
108
- },
109
- props.helperText
110
- ));
111
- case "bordered":
112
- return /* @__PURE__ */ React.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React.createElement("div", { key: i, className: "hawa-w-full hawa-rounded hawa-border" }, /* @__PURE__ */ React.createElement(
113
- "div",
114
- {
115
- className: cn(
116
- "radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all",
117
- props.direction === "rtl" ? "margin-left right-19px" : "margin-right left-23px"
118
- ),
119
- key: i + 1
120
- },
121
- /* @__PURE__ */ React.createElement(
122
- "input",
123
- {
124
- disabled: opt.disabled,
125
- id: opt.value.toString(),
126
- type: "radio",
127
- value: opt.value,
128
- name,
129
- onChange: () => handleChange(opt)
130
- }
131
- ),
132
- /* @__PURE__ */ React.createElement(
133
- "label",
134
- {
135
- htmlFor: opt.value.toString(),
136
- className: cn(
137
- "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",
138
- opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hawa-text-gray-900"
139
- )
140
- },
141
- opt.label
142
- )
143
- ))));
144
- case "cards":
145
- return /* @__PURE__ */ React.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ React.createElement("li", { key: o, onClick: () => handleChange(opt) }, /* @__PURE__ */ React.createElement(
146
- "input",
147
- {
148
- type: "radio",
149
- id: opt.value.toString(),
150
- name,
151
- value: opt.value.toString(),
152
- className: "hawa-peer hawa-hidden",
153
- required: true,
154
- disabled: opt.disabled
155
- }
156
- ), /* @__PURE__ */ React.createElement(
157
- "label",
158
- {
159
- htmlFor: opt.value.toString(),
160
- className: cn(
161
- "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",
162
- opt.disabled ? "hawa-opacity-50" : "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"
163
- )
164
- },
165
- /* @__PURE__ */ React.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ React.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ React.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
166
- ))));
167
- default:
168
- return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React.createElement(
169
- "div",
170
- {
171
- className: cn(
172
- "radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
173
- props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
174
- ),
175
- key: i + 1
176
- },
177
- /* @__PURE__ */ React.createElement(
178
- "input",
179
- {
180
- disabled: opt.disabled,
181
- id: opt.value.toString(),
182
- type: "radio",
183
- value: opt.value,
184
- name,
185
- onChange: () => handleChange(opt)
186
- }
187
- ),
188
- /* @__PURE__ */ React.createElement(
189
- "label",
190
- {
191
- htmlFor: opt.value.toString(),
192
- className: cn(
193
- "hawa-text-sm hawa-font-medium dark:hawa-text-white",
194
- opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
195
- )
196
- },
197
- opt.label
198
- )
199
- ))), /* @__PURE__ */ React.createElement(
200
- "p",
201
- {
202
- className: cn(
203
- "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
204
- props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
205
- )
206
- },
207
- props.helperText
208
- ));
209
- }
210
- }
211
- );
212
-
213
- export {
214
- Radio
215
- };