@sikka/hawa 0.26.31 → 0.26.33

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 (218) hide show
  1. package/dist/{Toast-pOd4uGZz.d.ts → Toast-YaClwi7z.d.ts} +9 -1
  2. package/dist/{Toast-VBd4UvlM.d.mts → Toast-ySvjL_-K.d.mts} +9 -1
  3. package/dist/accordion/index.mjs +7 -4
  4. package/dist/accordion/index.mjs.map +1 -1
  5. package/dist/alert/index.js +4 -4
  6. package/dist/alert/index.js.map +1 -1
  7. package/dist/alert/index.mjs +11 -8
  8. package/dist/alert/index.mjs.map +1 -1
  9. package/dist/appLayout/index.js +2 -1
  10. package/dist/appLayout/index.js.map +1 -1
  11. package/dist/appLayout/index.mjs +9 -5
  12. package/dist/appLayout/index.mjs.map +1 -1
  13. package/dist/appMenubar/index.mjs +9 -4
  14. package/dist/appMenubar/index.mjs.map +1 -1
  15. package/dist/appTabs/index.mjs +9 -4
  16. package/dist/appTabs/index.mjs.map +1 -1
  17. package/dist/appTopbar/index.mjs +9 -4
  18. package/dist/appTopbar/index.mjs.map +1 -1
  19. package/dist/avatar/index.js +2 -1
  20. package/dist/avatar/index.js.map +1 -1
  21. package/dist/avatar/index.mjs +9 -5
  22. package/dist/avatar/index.mjs.map +1 -1
  23. package/dist/backToTop/index.js +6 -3
  24. package/dist/backToTop/index.js.map +1 -1
  25. package/dist/backToTop/index.mjs +13 -7
  26. package/dist/backToTop/index.mjs.map +1 -1
  27. package/dist/badge/index.js +4 -3
  28. package/dist/badge/index.js.map +1 -1
  29. package/dist/badge/index.mjs +13 -7
  30. package/dist/badge/index.mjs.map +1 -1
  31. package/dist/button/index.mjs +7 -4
  32. package/dist/button/index.mjs.map +1 -1
  33. package/dist/card/index.mjs +9 -4
  34. package/dist/card/index.mjs.map +1 -1
  35. package/dist/carousel/index.js +10 -10
  36. package/dist/carousel/index.js.map +1 -1
  37. package/dist/carousel/index.mjs +19 -14
  38. package/dist/carousel/index.mjs.map +1 -1
  39. package/dist/checkbox/index.mjs +9 -4
  40. package/dist/checkbox/index.mjs.map +1 -1
  41. package/dist/chip/index.mjs +9 -4
  42. package/dist/chip/index.mjs.map +1 -1
  43. package/dist/chunk-A3ERTYS4.mjs +29 -0
  44. package/dist/codeBlock/index.js +1 -1
  45. package/dist/codeBlock/index.js.map +1 -1
  46. package/dist/codeBlock/index.mjs +84 -24
  47. package/dist/codeBlock/index.mjs.map +1 -1
  48. package/dist/collapsible/index.mjs +0 -2
  49. package/dist/collapsible/index.mjs.map +1 -1
  50. package/dist/colorPicker/index.js +2 -1
  51. package/dist/colorPicker/index.js.map +1 -1
  52. package/dist/colorPicker/index.mjs +92 -20
  53. package/dist/colorPicker/index.mjs.map +1 -1
  54. package/dist/combobox/index.js +4 -3
  55. package/dist/combobox/index.js.map +1 -1
  56. package/dist/combobox/index.mjs +445 -27
  57. package/dist/combobox/index.mjs.map +1 -1
  58. package/dist/command/index.mjs +429 -11
  59. package/dist/command/index.mjs.map +1 -1
  60. package/dist/dataTable/index.js +36 -27
  61. package/dist/dataTable/index.js.map +1 -1
  62. package/dist/dataTable/index.mjs +43 -31
  63. package/dist/dataTable/index.mjs.map +1 -1
  64. package/dist/destroyableCard/index.js +2 -2
  65. package/dist/destroyableCard/index.js.map +1 -1
  66. package/dist/destroyableCard/index.mjs +9 -6
  67. package/dist/destroyableCard/index.mjs.map +1 -1
  68. package/dist/dialog/index.mjs +9 -4
  69. package/dist/dialog/index.mjs.map +1 -1
  70. package/dist/docsLayout/index.js +2 -2
  71. package/dist/docsLayout/index.js.map +1 -1
  72. package/dist/docsLayout/index.mjs +9 -6
  73. package/dist/docsLayout/index.mjs.map +1 -1
  74. package/dist/docsSidebar/index.js +2 -2
  75. package/dist/docsSidebar/index.js.map +1 -1
  76. package/dist/docsSidebar/index.mjs +11 -6
  77. package/dist/docsSidebar/index.mjs.map +1 -1
  78. package/dist/dropdownMenu/index.mjs +9 -4
  79. package/dist/dropdownMenu/index.mjs.map +1 -1
  80. package/dist/elements/index.d.mts +4 -2
  81. package/dist/elements/index.d.ts +4 -2
  82. package/dist/elements/index.js +8 -135
  83. package/dist/elements/index.mjs +10 -14
  84. package/dist/fileDropzone/index.js +12 -11
  85. package/dist/fileDropzone/index.js.map +1 -1
  86. package/dist/fileDropzone/index.mjs +21 -17
  87. package/dist/fileDropzone/index.mjs.map +1 -1
  88. package/dist/fileUploader/index.js +2 -1
  89. package/dist/fileUploader/index.js.map +1 -1
  90. package/dist/fileUploader/index.mjs +2 -1
  91. package/dist/fileUploader/index.mjs.map +1 -1
  92. package/dist/glow/index.js +24 -17
  93. package/dist/glow/index.js.map +1 -1
  94. package/dist/glow/index.mjs +24 -17
  95. package/dist/glow/index.mjs.map +1 -1
  96. package/dist/hooks/index.d.mts +9 -18
  97. package/dist/hooks/index.d.ts +9 -18
  98. package/dist/hooks/index.mjs +146 -27
  99. package/dist/index.d.mts +18 -17
  100. package/dist/index.d.ts +18 -17
  101. package/dist/index.js +167 -172
  102. package/dist/index.mjs +589 -594
  103. package/dist/input/index.js +3 -2
  104. package/dist/input/index.js.map +1 -1
  105. package/dist/input/index.mjs +118 -19
  106. package/dist/input/index.mjs.map +1 -1
  107. package/dist/interfaceSettings/index.js +6 -4
  108. package/dist/interfaceSettings/index.js.map +1 -1
  109. package/dist/interfaceSettings/index.mjs +130 -28
  110. package/dist/interfaceSettings/index.mjs.map +1 -1
  111. package/dist/label/index.mjs +7 -4
  112. package/dist/label/index.mjs.map +1 -1
  113. package/dist/loading/index.mjs +9 -4
  114. package/dist/loading/index.mjs.map +1 -1
  115. package/dist/navbar/index.js +3 -2
  116. package/dist/navbar/index.js.map +1 -1
  117. package/dist/navbar/index.mjs +10 -6
  118. package/dist/navbar/index.mjs.map +1 -1
  119. package/dist/navigationMenu/index.mjs +9 -4
  120. package/dist/navigationMenu/index.mjs.map +1 -1
  121. package/dist/pagination/index.mjs +9 -4
  122. package/dist/pagination/index.mjs.map +1 -1
  123. package/dist/passwordInput/index.js +3 -2
  124. package/dist/passwordInput/index.js.map +1 -1
  125. package/dist/passwordInput/index.mjs +12 -6
  126. package/dist/passwordInput/index.mjs.map +1 -1
  127. package/dist/phoneInput/index.js +10 -5
  128. package/dist/phoneInput/index.js.map +1 -1
  129. package/dist/phoneInput/index.mjs +19 -11
  130. package/dist/phoneInput/index.mjs.map +1 -1
  131. package/dist/pinInput/index.js +3 -3
  132. package/dist/pinInput/index.js.map +1 -1
  133. package/dist/pinInput/index.mjs +12 -7
  134. package/dist/pinInput/index.mjs.map +1 -1
  135. package/dist/popover/index.mjs +9 -4
  136. package/dist/popover/index.mjs.map +1 -1
  137. package/dist/progress/index.mjs +9 -4
  138. package/dist/progress/index.mjs.map +1 -1
  139. package/dist/progressCircle/index.js +2 -2
  140. package/dist/progressCircle/index.js.map +1 -1
  141. package/dist/progressCircle/index.mjs +11 -6
  142. package/dist/progressCircle/index.mjs.map +1 -1
  143. package/dist/radio/index.js +6 -4
  144. package/dist/radio/index.js.map +1 -1
  145. package/dist/radio/index.mjs +13 -8
  146. package/dist/radio/index.mjs.map +1 -1
  147. package/dist/scrollArea/index.mjs +9 -4
  148. package/dist/scrollArea/index.mjs.map +1 -1
  149. package/dist/scrollIndicator/index.js +2 -1
  150. package/dist/scrollIndicator/index.js.map +1 -1
  151. package/dist/scrollIndicator/index.mjs +2 -1
  152. package/dist/scrollIndicator/index.mjs.map +1 -1
  153. package/dist/select/index.js +6 -2
  154. package/dist/select/index.js.map +1 -1
  155. package/dist/select/index.mjs +15 -8
  156. package/dist/select/index.mjs.map +1 -1
  157. package/dist/separator/index.mjs +9 -4
  158. package/dist/separator/index.mjs.map +1 -1
  159. package/dist/sheet/index.mjs +9 -4
  160. package/dist/sheet/index.mjs.map +1 -1
  161. package/dist/sidebar/index.mjs +9 -4
  162. package/dist/sidebar/index.mjs.map +1 -1
  163. package/dist/signature/index.js +31 -11
  164. package/dist/signature/index.js.map +1 -1
  165. package/dist/signature/index.mjs +40 -15
  166. package/dist/signature/index.mjs.map +1 -1
  167. package/dist/simpleTable/index.js +18 -14
  168. package/dist/simpleTable/index.js.map +1 -1
  169. package/dist/simpleTable/index.mjs +25 -18
  170. package/dist/simpleTable/index.mjs.map +1 -1
  171. package/dist/skeleton/index.mjs +9 -4
  172. package/dist/skeleton/index.mjs.map +1 -1
  173. package/dist/slider/index.mjs +9 -4
  174. package/dist/slider/index.mjs.map +1 -1
  175. package/dist/sortButton/index.mjs +268 -11
  176. package/dist/sortButton/index.mjs.map +1 -1
  177. package/dist/splitButton/index.mjs +267 -12
  178. package/dist/splitButton/index.mjs.map +1 -1
  179. package/dist/switch/index.js +2 -1
  180. package/dist/switch/index.js.map +1 -1
  181. package/dist/switch/index.mjs +11 -5
  182. package/dist/switch/index.mjs.map +1 -1
  183. package/dist/table/index.mjs +9 -4
  184. package/dist/table/index.mjs.map +1 -1
  185. package/dist/tabs/index.mjs +7 -4
  186. package/dist/tabs/index.mjs.map +1 -1
  187. package/dist/textarea/index.js +4 -4
  188. package/dist/textarea/index.js.map +1 -1
  189. package/dist/textarea/index.mjs +11 -8
  190. package/dist/textarea/index.mjs.map +1 -1
  191. package/dist/toast/index.d.mts +9 -1
  192. package/dist/toast/index.d.ts +9 -1
  193. package/dist/toast/index.js +3 -3
  194. package/dist/toast/index.js.map +1 -1
  195. package/dist/toast/index.mjs +145 -10
  196. package/dist/toast/index.mjs.map +1 -1
  197. package/dist/toaster/index.d.mts +5 -0
  198. package/dist/toaster/index.d.ts +5 -0
  199. package/dist/toaster/index.js +17 -142
  200. package/dist/toaster/index.js.map +1 -1
  201. package/dist/toaster/index.mjs +142 -135
  202. package/dist/toaster/index.mjs.map +1 -1
  203. package/package.json +1 -1
  204. package/dist/chunk-3ODWQVIA.mjs +0 -12
  205. package/dist/chunk-3ODWQVIA.mjs.map +0 -1
  206. package/dist/chunk-53OZVR57.mjs +0 -108
  207. package/dist/chunk-53OZVR57.mjs.map +0 -1
  208. package/dist/chunk-CBRGWUZG.mjs +0 -11
  209. package/dist/chunk-CBRGWUZG.mjs.map +0 -1
  210. package/dist/chunk-HYXZRCZW.mjs +0 -265
  211. package/dist/chunk-HYXZRCZW.mjs.map +0 -1
  212. package/dist/chunk-JNUGOUYJ.mjs +0 -154
  213. package/dist/chunk-JX5YLRCU.mjs +0 -443
  214. package/dist/chunk-JX5YLRCU.mjs.map +0 -1
  215. package/dist/chunk-NV3KR5Y7.mjs +0 -82
  216. package/dist/chunk-NV3KR5Y7.mjs.map +0 -1
  217. package/dist/chunk-OQ7MNEYW.mjs +0 -151
  218. package/dist/chunk-OQ7MNEYW.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/textarea/index.ts","../../elements/textarea/Textarea.tsx","../../util/index.ts","../../elements/skeleton/Skeleton.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx"],"sourcesContent":["export * from \"./Textarea\";\n","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 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 {...textareaProps}\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}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\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 return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\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\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...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 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 triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n open,\n content,\n children,\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={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent side={side} align=\"center\" {...contentProps}>\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,mBAAkB;AAUlB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,GAAkB;AAChB,QAAM,kBAAkB;AAAA,IACtB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SACE;AAAA,EACJ;AACA,SACE,6BAAAC,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT,gBAAgB,SAAS;AAAA,QACzB,WACE;AAAA,QACF;AAAA,MACF;AAA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QAC/D,eAAe;AAAA,MAClB,CAEJ;AAAA,MACC,YACC,qCAAC,YAAS,OAAO,EAAE,QAAQ,GAAG,GAAG,IAEjC;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,YAAY;AAAA,UACd;AAAA,UACA;AAAA,UACC,GAAG;AAAA;AAAA,MACN;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,sDACb,eAAe,QAAQ,OAAO,eAAe,KAAK,EAAE,SAAS,GAAE,KAC/D,eAAe,SAClB,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["React","React","React","import_react","React"]}
1
+ {"version":3,"sources":["../../elements/textarea/index.ts","../../elements/textarea/Textarea.tsx","../../util/index.ts","../../elements/skeleton/Skeleton.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx"],"sourcesContent":["export * from \"./Textarea\";\n","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 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 {...textareaProps}\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}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\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 return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\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\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...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 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 triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n open,\n content,\n children,\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={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent side={side} align=\"center\" {...contentProps}>\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,mBAAkB;AAUlB,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,GAAkB;AAChB,QAAM,kBAAkB;AAAA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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,UACC,WAAW;AAAA,YACT;AAAA,YACA,yCAAY;AAAA,UACd;AAAA,UACA;AAAA,UACC,GAAG;AAAA;AAAA,MACN;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","import_react","React"]}
@@ -1,10 +1,13 @@
1
- import {
2
- cn
3
- } from "../chunk-CBRGWUZG.mjs";
4
-
5
1
  // elements/textarea/Textarea.tsx
6
2
  import * as React4 from "react";
7
3
 
4
+ // util/index.ts
5
+ import { clsx } from "clsx";
6
+ import { twMerge } from "tailwind-merge";
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+
8
11
  // elements/skeleton/Skeleton.tsx
9
12
  import React from "react";
10
13
  function Skeleton({
@@ -155,16 +158,16 @@ var Textarea = React4.forwardRef(
155
158
  {
156
159
  className: "hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none"
157
160
  },
158
- textareaProps?.value ? String(textareaProps?.value).length : 0,
161
+ (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0,
159
162
  "/",
160
- textareaProps?.maxLength
163
+ textareaProps == null ? void 0 : textareaProps.maxLength
161
164
  )),
162
165
  isLoading ? /* @__PURE__ */ React4.createElement(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ React4.createElement(
163
166
  "textarea",
164
167
  {
165
168
  className: cn(
166
169
  "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",
167
- classNames?.textarea
170
+ classNames == null ? void 0 : classNames.textarea
168
171
  ),
169
172
  ref,
170
173
  ...textareaProps
@@ -179,7 +182,7 @@ var Textarea = React4.forwardRef(
179
182
  )
180
183
  },
181
184
  props.helperText
182
- ), showCount && countPosition === "bottom" && /* @__PURE__ */ React4.createElement("div", { className: "hawa-text-start hawa-text-xs hawa-transition-all" }, textareaProps?.value ? String(textareaProps?.value).length : 0, "/", textareaProps?.maxLength))
185
+ ), showCount && countPosition === "bottom" && /* @__PURE__ */ React4.createElement("div", { className: "hawa-text-start hawa-text-xs hawa-transition-all" }, (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0, "/", textareaProps == null ? void 0 : textareaProps.maxLength))
183
186
  );
184
187
  }
185
188
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/textarea/Textarea.tsx","../../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 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 {...textareaProps}\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 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}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\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 return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\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\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...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 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 triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n open,\n content,\n children,\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={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent side={side} align=\"center\" {...contentProps}>\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipPro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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,QAGD,eAAe,QAAQ,OAAO,eAAe,KAAK,EAAE,SAAS;AAAA,QAAE;AAAA,QAC/D,eAAe;AAAA,MAClB,CAEJ;AAAA,MACC,YACC,qCAAC,YAAS,OAAO,EAAE,QAAQ,GAAG,GAAG,IAEjC;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,YAAY;AAAA,UACd;AAAA,UACA;AAAA,UACC,GAAG;AAAA;AAAA,MACN;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,sDACb,eAAe,QAAQ,OAAO,eAAe,KAAK,EAAE,SAAS,GAAE,KAC/D,eAAe,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 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 {...textareaProps}\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}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\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 return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\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\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...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 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 triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n open,\n content,\n children,\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={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent side={side} align=\"center\" {...contentProps}>\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n"],"mappings":";AAAA,Y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A;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,UACC,WAAW;AAAA,YACT;AAAA,YACA,yCAAY;AAAA,UACd;AAAA,UACA;AAAA,UACC,GAAG;AAAA;AAAA,MACN;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"]}
@@ -22,5 +22,13 @@ declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimit
22
22
  } & React.RefAttributes<HTMLDivElement>>;
23
23
  type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
24
24
  type ToastActionElement = React.ReactElement<typeof ToastAction>;
25
+ type ToasterToastProps = ToastProps & {
26
+ id: string;
27
+ title?: React.ReactNode;
28
+ description?: React.ReactNode;
29
+ severity?: "info" | "warning" | "error" | "success" | "none";
30
+ action?: ToastActionElement;
31
+ size?: "default" | "sm";
32
+ };
25
33
 
26
- export { Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport };
34
+ export { Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, type ToasterToastProps };
@@ -22,5 +22,13 @@ declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimit
22
22
  } & React.RefAttributes<HTMLDivElement>>;
23
23
  type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
24
24
  type ToastActionElement = React.ReactElement<typeof ToastAction>;
25
+ type ToasterToastProps = ToastProps & {
26
+ id: string;
27
+ title?: React.ReactNode;
28
+ description?: React.ReactNode;
29
+ severity?: "info" | "warning" | "error" | "success" | "none";
30
+ action?: ToastActionElement;
31
+ size?: "default" | "sm";
32
+ };
25
33
 
26
- export { Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport };
34
+ export { Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, type ToasterToastProps };
@@ -43,7 +43,6 @@ module.exports = __toCommonJS(toast_exports);
43
43
  // elements/toast/Toast.tsx
44
44
  var React = __toESM(require("react"));
45
45
  var ToastPrimitives = __toESM(require("@radix-ui/react-toast"));
46
- var import_class_variance_authority = require("class-variance-authority");
47
46
 
48
47
  // util/index.ts
49
48
  var import_clsx = require("clsx");
@@ -53,6 +52,7 @@ function cn(...inputs) {
53
52
  }
54
53
 
55
54
  // elements/toast/Toast.tsx
55
+ var import_class_variance_authority = require("class-variance-authority");
56
56
  var toastVariants = (0, import_class_variance_authority.cva)(
57
57
  "hawa-group hawa-z-[900] hawa-pointer-events-auto hawa-relative hawa-flex hawa-w-full hawa-items-center hawa-justify-between hawa-overflow-hidden hawa-rounded-md hawa-border hawa-shadow-lg hawa-transition-all data-[swipe=cancel]:hawa-translate-x-0 data-[swipe=end]:hawa-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:hawa-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:hawa-transition-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[swipe=end]:hawa-animate-out data-[state=closed]:hawa-fade-out-80 data-[state=open]:hawa-slide-in-from-top-full data-[state=open]:sm:hawa-slide-in-from-bottom-full",
58
58
  {
@@ -78,7 +78,7 @@ var sizeStyles = {
78
78
  sm: "hawa-text-xs"
79
79
  };
80
80
  var ToastProvider = ToastPrimitives.Provider;
81
- var ToastViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
81
+ var ToastViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
82
82
  ToastPrimitives.Viewport,
83
83
  {
84
84
  ref,
@@ -88,7 +88,7 @@ var ToastViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
88
88
  ),
89
89
  ...props
90
90
  }
91
- ), /* @__PURE__ */ React.createElement("div", null, "inside ToastViewport")));
91
+ ));
92
92
  ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
93
93
  var Toast = React.forwardRef(({ className, variant, severity = "none", direction, ...props }, ref) => {
94
94
  return /* @__PURE__ */ React.createElement(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/toast/index.ts","../../elements/toast/Toast.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Toast\";\n","import * as React from \"react\";\n\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\nconst toastVariants = cva(\n \"hawa-group hawa-z-[900] hawa-pointer-events-auto hawa-relative hawa-flex hawa-w-full hawa-items-center hawa-justify-between hawa-overflow-hidden hawa-rounded-md hawa-border hawa-shadow-lg hawa-transition-all data-[swipe=cancel]:hawa-translate-x-0 data-[swipe=end]:hawa-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:hawa-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:hawa-transition-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[swipe=end]:hawa-animate-out data-[state=closed]:hawa-fade-out-80 data-[state=open]:hawa-slide-in-from-top-full data-[state=open]:sm:hawa-slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"hawa-border hawa-bg-background hawa-text-foreground\",\n destructive:\n \"hawa-destructive hawa-group hawa-border-destructive hawa-bg-destructive hawa-text-destructive-foreground\"\n },\n severity: {\n info: \"hawa-info hawa-group hawa-text-info-foreground hawa-bg-info\",\n warning:\n \"hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning\",\n error:\n \"hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white\",\n success:\n \"hawa-success hawa-group hawa-text-success-foreground hawa-bg-success\",\n none: \"\"\n }\n },\n\n defaultVariants: { variant: \"default\" }\n }\n);\n\nlet sizeStyles = {\n default: \"hawa-text-sm\", // Update this based on the desired padding for rtl\n sm: \"hawa-text-xs\"\n};\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n<div>\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-top-0 hawa-z-[100] hawa-flex hawa-max-h-screen hawa-w-full hawa-flex-col-reverse hawa-p-4 sm:hawa-bottom-0 sm:hawa-right-0 sm:hawa-top-auto sm:hawa-flex-col md:hawa-max-w-[420px]\",\n className\n )}\n {...props}\n />\n <div>inside ToastViewport</div>\n</div>\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants> & {\n direction?: DirectionType;\n }\n>(({ className, variant, severity = \"none\", direction, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(\n toastVariants({ variant, severity }),\n className,\n direction === \"rtl\"\n ? \"data-[state=closed]:hawa-slide-out-to-left-full\"\n : \"data-[state=closed]:hawa-slide-out-to-right-full\"\n )}\n dir={direction}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => {\n return (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"hawa-inline-flex hawa-h-8 hawa-shrink-0 hawa-items-center hawa-justify-center hawa-rounded-md hawa-border hawa-bg-transparent hawa-px-3 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors hover:hawa-bg-secondary hover:hawa-text-secondary-foreground focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n \"group-[.info]:hawa-border-muted/40 group-[.info]:hover:hawa-border-info/30 group-[.info]:hover:hawa-bg-info group-[.info]:hover:hawa-text-info-foreground group-[.info]:focus:hawa-ring-info\",\n \"group-[.error]:hawa-border-muted/40 group-[.error]:hover:hawa-border-error/30 group-[.error]:hover:hawa-bg-error group-[.error]:hover:hawa-text-error-foreground group-[.error]:focus:hawa-ring-error\",\n \"group-[.success]:hawa-border-muted/40 group-[.success]:hover:hawa-border-success/30 group-[.success]:hover:hawa-bg-success group-[.success]:hover:hawa-text-success-foreground group-[.success]:focus:hawa-ring-success\",\n \"group-[.warning]:hawa-border-muted/40 group-[.warning]:hover:hawa-border-warning/30 group-[.warning]:hover:hawa-bg-warning group-[.warning]:hover:hawa-text-warning-foreground group-[.warning]:focus:hawa-ring-warning\",\n \"hawa-whitespace-nowrap\",\n className\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n // \"hawa-absolute hawa-start-2 hawa-top-2\",\n // \"group-hover:hawa-opacity-100\",\n \"hawa-opacity-100\",\n \"hawa-rounded-md hawa-p-1 hawa-text-foreground/50 hawa-transition-opacity hover:hawa-text-foreground focus:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 group-[.destructive]:hawa-text-red-300 group-[.destructive]:hover:hawa-text-red-50 group-[.destructive]:focus:hawa-ring-red-400 group-[.destructive]:focus:hawa-ring-offset-red-600\",\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-text-sm hawa-font-semibold\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-opacity-90\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,sBAAiC;AACjC,sCAAuC;;;ACHvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADIA,IAAM,oBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,QACR,MAAM;AAAA,QACN,SACE;AAAA,QACF,OACE;AAAA,QACF,SACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IAEA,iBAAiB,EAAE,SAAS,UAAU;AAAA,EACxC;AACF;AAEA,IAAI,aAAa;AAAA,EACf,SAAS;AAAA;AAAA,EACT,IAAI;AACN;AACA,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MAAK;AAAA,MACL,SAAQ;AAAA;AAAA,IAER;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,GAAE;AAAA,QACF,UAAS;AAAA;AAAA,IACV;AAAA,EACH;AACF,CACD;AACD,WAAW,cAA8B,sBAAM;AAE/C,IAAM,aAAmB,iBAKvB,CAAC,EAAE,WAAW,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5C;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,WAAW,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAA8B,sBAAM;AAE/C,IAAM,mBAAyB,iBAK7B,CAAC,EAAE,WAAW,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5C;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,WAAW,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAA8B,4BAAY;","names":[]}
1
+ {"version":3,"sources":["../../elements/toast/index.ts","../../elements/toast/Toast.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Toast\";\n","import * as React from \"react\";\n\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst toastVariants = cva(\n \"hawa-group hawa-z-[900] hawa-pointer-events-auto hawa-relative hawa-flex hawa-w-full hawa-items-center hawa-justify-between hawa-overflow-hidden hawa-rounded-md hawa-border hawa-shadow-lg hawa-transition-all data-[swipe=cancel]:hawa-translate-x-0 data-[swipe=end]:hawa-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:hawa-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:hawa-transition-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[swipe=end]:hawa-animate-out data-[state=closed]:hawa-fade-out-80 data-[state=open]:hawa-slide-in-from-top-full data-[state=open]:sm:hawa-slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"hawa-border hawa-bg-background hawa-text-foreground\",\n destructive:\n \"hawa-destructive hawa-group hawa-border-destructive hawa-bg-destructive hawa-text-destructive-foreground\"\n },\n severity: {\n info: \"hawa-info hawa-group hawa-text-info-foreground hawa-bg-info\",\n warning:\n \"hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning\",\n error:\n \"hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white\",\n success:\n \"hawa-success hawa-group hawa-text-success-foreground hawa-bg-success\",\n none: \"\"\n }\n },\n\n defaultVariants: { variant: \"default\" }\n }\n);\n\nlet sizeStyles = {\n default: \"hawa-text-sm\", // Update this based on the desired padding for rtl\n sm: \"hawa-text-xs\"\n};\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-top-0 hawa-z-[100] hawa-flex hawa-max-h-screen hawa-w-full hawa-flex-col-reverse hawa-p-4 sm:hawa-bottom-0 sm:hawa-right-0 sm:hawa-top-auto sm:hawa-flex-col md:hawa-max-w-[420px]\",\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants> & {\n direction?: DirectionType;\n }\n>(({ className, variant, severity = \"none\", direction, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(\n toastVariants({ variant, severity }),\n className,\n direction === \"rtl\"\n ? \"data-[state=closed]:hawa-slide-out-to-left-full\"\n : \"data-[state=closed]:hawa-slide-out-to-right-full\"\n )}\n dir={direction}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => {\n return (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"hawa-inline-flex hawa-h-8 hawa-shrink-0 hawa-items-center hawa-justify-center hawa-rounded-md hawa-border hawa-bg-transparent hawa-px-3 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors hover:hawa-bg-secondary hover:hawa-text-secondary-foreground focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n \"group-[.info]:hawa-border-muted/40 group-[.info]:hover:hawa-border-info/30 group-[.info]:hover:hawa-bg-info group-[.info]:hover:hawa-text-info-foreground group-[.info]:focus:hawa-ring-info\",\n \"group-[.error]:hawa-border-muted/40 group-[.error]:hover:hawa-border-error/30 group-[.error]:hover:hawa-bg-error group-[.error]:hover:hawa-text-error-foreground group-[.error]:focus:hawa-ring-error\",\n \"group-[.success]:hawa-border-muted/40 group-[.success]:hover:hawa-border-success/30 group-[.success]:hover:hawa-bg-success group-[.success]:hover:hawa-text-success-foreground group-[.success]:focus:hawa-ring-success\",\n \"group-[.warning]:hawa-border-muted/40 group-[.warning]:hover:hawa-border-warning/30 group-[.warning]:hover:hawa-bg-warning group-[.warning]:hover:hawa-text-warning-foreground group-[.warning]:focus:hawa-ring-warning\",\n \"hawa-whitespace-nowrap\",\n className\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n // \"hawa-absolute hawa-start-2 hawa-top-2\",\n // \"group-hover:hawa-opacity-100\",\n \"hawa-opacity-100\",\n \"hawa-rounded-md hawa-p-1 hawa-text-foreground/50 hawa-transition-opacity hover:hawa-text-foreground focus:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 group-[.destructive]:hawa-text-red-300 group-[.destructive]:hover:hawa-text-red-50 group-[.destructive]:focus:hawa-ring-red-400 group-[.destructive]:focus:hawa-ring-offset-red-600\",\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-text-sm hawa-font-semibold\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-opacity-90\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\nexport type ToasterToastProps = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n severity?: \"info\" | \"warning\" | \"error\" | \"success\" | \"none\";\n action?: ToastActionElement;\n size?: \"default\" | \"sm\";\n};\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,sBAAiC;;;ACFjC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADDA,sCAAuC;AAIvC,IAAM,oBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,QACR,MAAM;AAAA,QACN,SACE;AAAA,QACF,OACE;AAAA,QACF,SACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IAEA,iBAAiB,EAAE,SAAS,UAAU;AAAA,EACxC;AACF;AAEA,IAAI,aAAa;AAAA,EACf,SAAS;AAAA;AAAA,EACT,IAAI;AACN;AACA,IAAM,gBAAgC;AAEtC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;A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AAE/C,IAAM,aAAmB,iBAKvB,CAAC,EAAE,WAAW,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5C;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,WAAW,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAA8B,sBAAM;AAE/C,IAAM,mBAAyB,iBAK7B,CAAC,EAAE,WAAW,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5C;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,WAAW,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAA8B,4BAAY;","names":[]}
@@ -1,13 +1,148 @@
1
- import {
2
- Toast,
3
- ToastAction,
4
- ToastClose,
5
- ToastDescription,
6
- ToastProvider,
7
- ToastTitle,
8
- ToastViewport
9
- } from "../chunk-OQ7MNEYW.mjs";
10
- import "../chunk-CBRGWUZG.mjs";
1
+ // elements/toast/Toast.tsx
2
+ import * as React from "react";
3
+ import * as ToastPrimitives from "@radix-ui/react-toast";
4
+
5
+ // util/index.ts
6
+ import { clsx } from "clsx";
7
+ import { twMerge } from "tailwind-merge";
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+
12
+ // elements/toast/Toast.tsx
13
+ import { cva } from "class-variance-authority";
14
+ var toastVariants = cva(
15
+ "hawa-group hawa-z-[900] hawa-pointer-events-auto hawa-relative hawa-flex hawa-w-full hawa-items-center hawa-justify-between hawa-overflow-hidden hawa-rounded-md hawa-border hawa-shadow-lg hawa-transition-all data-[swipe=cancel]:hawa-translate-x-0 data-[swipe=end]:hawa-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:hawa-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:hawa-transition-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[swipe=end]:hawa-animate-out data-[state=closed]:hawa-fade-out-80 data-[state=open]:hawa-slide-in-from-top-full data-[state=open]:sm:hawa-slide-in-from-bottom-full",
16
+ {
17
+ variants: {
18
+ variant: {
19
+ default: "hawa-border hawa-bg-background hawa-text-foreground",
20
+ destructive: "hawa-destructive hawa-group hawa-border-destructive hawa-bg-destructive hawa-text-destructive-foreground"
21
+ },
22
+ severity: {
23
+ info: "hawa-info hawa-group hawa-text-info-foreground hawa-bg-info",
24
+ warning: "hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning",
25
+ error: "hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white",
26
+ success: "hawa-success hawa-group hawa-text-success-foreground hawa-bg-success",
27
+ none: ""
28
+ }
29
+ },
30
+ defaultVariants: { variant: "default" }
31
+ }
32
+ );
33
+ var sizeStyles = {
34
+ default: "hawa-text-sm",
35
+ // Update this based on the desired padding for rtl
36
+ sm: "hawa-text-xs"
37
+ };
38
+ var ToastProvider = ToastPrimitives.Provider;
39
+ var ToastViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
40
+ ToastPrimitives.Viewport,
41
+ {
42
+ ref,
43
+ className: cn(
44
+ "hawa-fixed hawa-top-0 hawa-z-[100] hawa-flex hawa-max-h-screen hawa-w-full hawa-flex-col-reverse hawa-p-4 sm:hawa-bottom-0 sm:hawa-right-0 sm:hawa-top-auto sm:hawa-flex-col md:hawa-max-w-[420px]",
45
+ className
46
+ ),
47
+ ...props
48
+ }
49
+ ));
50
+ ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
51
+ var Toast = React.forwardRef(({ className, variant, severity = "none", direction, ...props }, ref) => {
52
+ return /* @__PURE__ */ React.createElement(
53
+ ToastPrimitives.Root,
54
+ {
55
+ ref,
56
+ className: cn(
57
+ toastVariants({ variant, severity }),
58
+ className,
59
+ direction === "rtl" ? "data-[state=closed]:hawa-slide-out-to-left-full" : "data-[state=closed]:hawa-slide-out-to-right-full"
60
+ ),
61
+ dir: direction,
62
+ ...props
63
+ }
64
+ );
65
+ });
66
+ Toast.displayName = ToastPrimitives.Root.displayName;
67
+ var ToastAction = React.forwardRef(({ className, ...props }, ref) => {
68
+ return /* @__PURE__ */ React.createElement(
69
+ ToastPrimitives.Action,
70
+ {
71
+ ref,
72
+ className: cn(
73
+ "hawa-inline-flex hawa-h-8 hawa-shrink-0 hawa-items-center hawa-justify-center hawa-rounded-md hawa-border hawa-bg-transparent hawa-px-3 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors hover:hawa-bg-secondary hover:hawa-text-secondary-foreground focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
74
+ "group-[.info]:hawa-border-muted/40 group-[.info]:hover:hawa-border-info/30 group-[.info]:hover:hawa-bg-info group-[.info]:hover:hawa-text-info-foreground group-[.info]:focus:hawa-ring-info",
75
+ "group-[.error]:hawa-border-muted/40 group-[.error]:hover:hawa-border-error/30 group-[.error]:hover:hawa-bg-error group-[.error]:hover:hawa-text-error-foreground group-[.error]:focus:hawa-ring-error",
76
+ "group-[.success]:hawa-border-muted/40 group-[.success]:hover:hawa-border-success/30 group-[.success]:hover:hawa-bg-success group-[.success]:hover:hawa-text-success-foreground group-[.success]:focus:hawa-ring-success",
77
+ "group-[.warning]:hawa-border-muted/40 group-[.warning]:hover:hawa-border-warning/30 group-[.warning]:hover:hawa-bg-warning group-[.warning]:hover:hawa-text-warning-foreground group-[.warning]:focus:hawa-ring-warning",
78
+ "hawa-whitespace-nowrap",
79
+ className
80
+ ),
81
+ ...props
82
+ }
83
+ );
84
+ });
85
+ ToastAction.displayName = ToastPrimitives.Action.displayName;
86
+ var ToastClose = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
87
+ ToastPrimitives.Close,
88
+ {
89
+ ref,
90
+ className: cn(
91
+ // "hawa-absolute hawa-start-2 hawa-top-2",
92
+ // "group-hover:hawa-opacity-100",
93
+ "hawa-opacity-100",
94
+ "hawa-rounded-md hawa-p-1 hawa-text-foreground/50 hawa-transition-opacity hover:hawa-text-foreground focus:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 group-[.destructive]:hawa-text-red-300 group-[.destructive]:hover:hawa-text-red-50 group-[.destructive]:focus:hawa-ring-red-400 group-[.destructive]:focus:hawa-ring-offset-red-600",
95
+ className
96
+ ),
97
+ "toast-close": "",
98
+ ...props
99
+ },
100
+ /* @__PURE__ */ React.createElement(
101
+ "svg",
102
+ {
103
+ "aria-label": "Close Icon",
104
+ "aria-hidden": "true",
105
+ className: "hawa-icon",
106
+ fill: "currentColor",
107
+ viewBox: "0 0 20 20"
108
+ },
109
+ /* @__PURE__ */ React.createElement(
110
+ "path",
111
+ {
112
+ fillRule: "evenodd",
113
+ d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
114
+ clipRule: "evenodd"
115
+ }
116
+ )
117
+ )
118
+ ));
119
+ ToastClose.displayName = ToastPrimitives.Close.displayName;
120
+ var ToastTitle = React.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ React.createElement(
121
+ ToastPrimitives.Title,
122
+ {
123
+ ref,
124
+ className: cn(
125
+ "hawa-select-text hawa-text-sm hawa-font-semibold",
126
+ sizeStyles[size],
127
+ className
128
+ ),
129
+ ...props
130
+ }
131
+ ));
132
+ ToastTitle.displayName = ToastPrimitives.Title.displayName;
133
+ var ToastDescription = React.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ React.createElement(
134
+ ToastPrimitives.Description,
135
+ {
136
+ ref,
137
+ className: cn(
138
+ "hawa-select-text hawa-opacity-90",
139
+ sizeStyles[size],
140
+ className
141
+ ),
142
+ ...props
143
+ }
144
+ ));
145
+ ToastDescription.displayName = ToastPrimitives.Description.displayName;
11
146
  export {
12
147
  Toast,
13
148
  ToastAction,
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../elements/toast/Toast.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nconst toastVariants = cva(\n \"hawa-group hawa-z-[900] hawa-pointer-events-auto hawa-relative hawa-flex hawa-w-full hawa-items-center hawa-justify-between hawa-overflow-hidden hawa-rounded-md hawa-border hawa-shadow-lg hawa-transition-all data-[swipe=cancel]:hawa-translate-x-0 data-[swipe=end]:hawa-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:hawa-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:hawa-transition-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[swipe=end]:hawa-animate-out data-[state=closed]:hawa-fade-out-80 data-[state=open]:hawa-slide-in-from-top-full data-[state=open]:sm:hawa-slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"hawa-border hawa-bg-background hawa-text-foreground\",\n destructive:\n \"hawa-destructive hawa-group hawa-border-destructive hawa-bg-destructive hawa-text-destructive-foreground\"\n },\n severity: {\n info: \"hawa-info hawa-group hawa-text-info-foreground hawa-bg-info\",\n warning:\n \"hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning\",\n error:\n \"hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white\",\n success:\n \"hawa-success hawa-group hawa-text-success-foreground hawa-bg-success\",\n none: \"\"\n }\n },\n\n defaultVariants: { variant: \"default\" }\n }\n);\n\nlet sizeStyles = {\n default: \"hawa-text-sm\", // Update this based on the desired padding for rtl\n sm: \"hawa-text-xs\"\n};\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"hawa-fixed hawa-top-0 hawa-z-[100] hawa-flex hawa-max-h-screen hawa-w-full hawa-flex-col-reverse hawa-p-4 sm:hawa-bottom-0 sm:hawa-right-0 sm:hawa-top-auto sm:hawa-flex-col md:hawa-max-w-[420px]\",\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants> & {\n direction?: DirectionType;\n }\n>(({ className, variant, severity = \"none\", direction, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(\n toastVariants({ variant, severity }),\n className,\n direction === \"rtl\"\n ? \"data-[state=closed]:hawa-slide-out-to-left-full\"\n : \"data-[state=closed]:hawa-slide-out-to-right-full\"\n )}\n dir={direction}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => {\n return (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"hawa-inline-flex hawa-h-8 hawa-shrink-0 hawa-items-center hawa-justify-center hawa-rounded-md hawa-border hawa-bg-transparent hawa-px-3 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors hover:hawa-bg-secondary hover:hawa-text-secondary-foreground focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n \"group-[.info]:hawa-border-muted/40 group-[.info]:hover:hawa-border-info/30 group-[.info]:hover:hawa-bg-info group-[.info]:hover:hawa-text-info-foreground group-[.info]:focus:hawa-ring-info\",\n \"group-[.error]:hawa-border-muted/40 group-[.error]:hover:hawa-border-error/30 group-[.error]:hover:hawa-bg-error group-[.error]:hover:hawa-text-error-foreground group-[.error]:focus:hawa-ring-error\",\n \"group-[.success]:hawa-border-muted/40 group-[.success]:hover:hawa-border-success/30 group-[.success]:hover:hawa-bg-success group-[.success]:hover:hawa-text-success-foreground group-[.success]:focus:hawa-ring-success\",\n \"group-[.warning]:hawa-border-muted/40 group-[.warning]:hover:hawa-border-warning/30 group-[.warning]:hover:hawa-bg-warning group-[.warning]:hover:hawa-text-warning-foreground group-[.warning]:focus:hawa-ring-warning\",\n \"hawa-whitespace-nowrap\",\n className\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n // \"hawa-absolute hawa-start-2 hawa-top-2\",\n // \"group-hover:hawa-opacity-100\",\n \"hawa-opacity-100\",\n \"hawa-rounded-md hawa-p-1 hawa-text-foreground/50 hawa-transition-opacity hover:hawa-text-foreground focus:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 group-[.destructive]:hawa-text-red-300 group-[.destructive]:hover:hawa-text-red-50 group-[.destructive]:focus:hawa-ring-red-400 group-[.destructive]:focus:hawa-ring-offset-red-600\",\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <svg\n aria-label=\"Close Icon\"\n aria-hidden=\"true\"\n className=\"hawa-icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-text-sm hawa-font-semibold\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description> & {\n size: \"default\" | \"sm\";\n }\n>(({ className, size = \"default\", ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\n \"hawa-select-text hawa-opacity-90\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\nexport type ToasterToastProps = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n severity?: \"info\" | \"warning\" | \"error\" | \"success\" | \"none\";\n action?: ToastActionElement;\n size?: \"default\" | \"sm\";\n};\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";AAAA,YAAY,WAAW;AAEvB,YAAY,qBAAqB;;;ACFjC,SAAS,YAA6B;AACtC,S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A;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,YAAY,cAA8B,uBAAO;AAEjD,IAAM,aAAmB,iBAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA;AAAA;AAAA,MAGT;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,eAAY;AAAA,IACX,GAAG;AAAA;AAAA,EAEJ;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,eAAY;AAAA,MACZ,WAAU;AAAA,MACV,MAAK;AAAA,MACL,SAAQ;AAAA;AAAA,IAER;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,GAAE;AAAA,QACF,UAAS;AAAA;AAAA,IACV;AAAA,EACH;AACF,CACD;AACD,WAAW,cAA8B,sBAAM;AAE/C,IAAM,aAAmB,iBAKvB,CAAC,EAAE,WAAW,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5C;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,WAAW,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAA8B,sBAAM;AAE/C,IAAM,mBAAyB,iBAK7B,CAAC,EAAE,WAAW,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5C;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,WAAW,IAAI;AAAA,MACf;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAA8B,4BAAY;","names":[]}
@@ -1,8 +1,13 @@
1
1
  import React__default from 'react';
2
2
  import { D as DirectionType } from '../commonTypes-_11epZYh.mjs';
3
+ import { ToasterToastProps } from '../toast/index.mjs';
4
+ import 'class-variance-authority/types';
5
+ import '@radix-ui/react-toast';
6
+ import 'class-variance-authority';
3
7
 
4
8
  type ToasterProps = {
5
9
  direction?: DirectionType;
10
+ toasts?: ToasterToastProps[];
6
11
  };
7
12
  declare function Toaster(props: ToasterProps): React__default.JSX.Element;
8
13
 
@@ -1,8 +1,13 @@
1
1
  import React__default from 'react';
2
2
  import { D as DirectionType } from '../commonTypes-_11epZYh.js';
3
+ import { ToasterToastProps } from '../toast/index.js';
4
+ import 'class-variance-authority/types';
5
+ import '@radix-ui/react-toast';
6
+ import 'class-variance-authority';
3
7
 
4
8
  type ToasterProps = {
5
9
  direction?: DirectionType;
10
+ toasts?: ToasterToastProps[];
6
11
  };
7
12
  declare function Toaster(props: ToasterProps): React__default.JSX.Element;
8
13