@sikka/hawa 0.48.0-next → 0.49.0-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/index.js +3 -28
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +3 -28
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert/index.js +53 -98
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +53 -98
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.d.mts +2 -0
- package/dist/appLayout/index.d.ts +2 -0
- package/dist/appLayout/index.js +263 -409
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +263 -409
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appMenubar/index.js +15 -20
- package/dist/appMenubar/index.js.map +1 -1
- package/dist/appMenubar/index.mjs +15 -20
- package/dist/appMenubar/index.mjs.map +1 -1
- package/dist/appTabs/index.js +28 -37
- package/dist/appTabs/index.js.map +1 -1
- package/dist/appTabs/index.mjs +28 -37
- package/dist/appTabs/index.mjs.map +1 -1
- package/dist/appTopbar/index.js +125 -173
- package/dist/appTopbar/index.js.map +1 -1
- package/dist/appTopbar/index.mjs +125 -173
- package/dist/appTopbar/index.mjs.map +1 -1
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/backToTop/index.js +50 -82
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +50 -82
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/badge/index.d.mts +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/badge/index.js +2 -18
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +2 -18
- package/dist/badge/index.mjs.map +1 -1
- package/dist/blocks/auth/index.d.mts +1 -0
- package/dist/blocks/auth/index.d.ts +1 -0
- package/dist/blocks/auth/index.js +539 -792
- package/dist/blocks/auth/index.mjs +433 -604
- package/dist/blocks/feedback/index.js +214 -375
- package/dist/blocks/feedback/index.mjs +12 -25
- package/dist/blocks/index.d.mts +1 -0
- package/dist/blocks/index.d.ts +1 -0
- package/dist/blocks/index.js +940 -1445
- package/dist/blocks/index.mjs +469 -615
- package/dist/blocks/misc/index.js +136 -251
- package/dist/blocks/misc/index.mjs +29 -54
- package/dist/blocks/pricing/index.js +220 -397
- package/dist/blocks/pricing/index.mjs +63 -134
- package/dist/breadcrumb/index.js +1 -5
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/breadcrumb/index.mjs +1 -5
- package/dist/breadcrumb/index.mjs.map +1 -1
- package/dist/button/index.js +50 -82
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +50 -82
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js +50 -82
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +50 -82
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/card/index.js +7 -35
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +7 -35
- package/dist/card/index.mjs.map +1 -1
- package/dist/carousel/index.js +15 -27
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +15 -27
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/checkbox/index.js +2 -13
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +2 -13
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chip/index.js +2 -16
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +2 -16
- package/dist/chip/index.mjs.map +1 -1
- package/dist/{chunk-WUMDFBEK.mjs → chunk-3CHFVHTW.mjs} +43 -54
- package/dist/{chunk-2LUXOXAL.mjs → chunk-5SQBJRWE.mjs} +3 -9
- package/dist/{chunk-C2UOOH4X.mjs → chunk-B53SP2WZ.mjs} +3 -17
- package/dist/chunk-GHGWQVTM.mjs +150 -0
- package/dist/{chunk-5S5DR7KF.mjs → chunk-I23ONEDJ.mjs} +2 -10
- package/dist/{chunk-JFWD2ICY.mjs → chunk-JT7R3L5O.mjs} +54 -62
- package/dist/{chunk-6SJUUJOV.mjs → chunk-KDGJZPWK.mjs} +295 -574
- package/dist/{chunk-AWJSHOYU.mjs → chunk-KSJGXQTE.mjs} +1 -1
- package/dist/{chunk-NMW4GM4G.mjs → chunk-SE2JMXYG.mjs} +104 -144
- package/dist/{chunk-GBLWUEYN.mjs → chunk-ULRL4WI6.mjs} +176 -256
- package/dist/{chunk-IFWYR5W2.mjs → chunk-VUELRPUL.mjs} +57 -117
- package/dist/{chunk-WL7C2A5D.mjs → chunk-WQR4XZGL.mjs} +8 -15
- package/dist/codeBlock/index.js +50 -82
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +50 -82
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.js +21 -33
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +22 -37
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.d.mts +1 -1
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.js +141 -223
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +141 -223
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.d.mts +1 -1
- package/dist/command/index.d.ts +1 -1
- package/dist/command/index.js +129 -212
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +129 -212
- package/dist/command/index.mjs.map +1 -1
- package/dist/dataTable/index.js +254 -394
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +254 -394
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.js +64 -105
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +64 -105
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/destroyableCard/index.js +8 -39
- package/dist/destroyableCard/index.js.map +1 -1
- package/dist/destroyableCard/index.mjs +8 -39
- package/dist/destroyableCard/index.mjs.map +1 -1
- package/dist/dialog/index.js +70 -122
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +70 -122
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +169 -358
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +169 -358
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/docsSidebar/index.js +9 -16
- package/dist/docsSidebar/index.js.map +1 -1
- package/dist/docsSidebar/index.mjs +9 -16
- package/dist/docsSidebar/index.mjs.map +1 -1
- package/dist/dropdownMenu/index.js +124 -164
- package/dist/dropdownMenu/index.js.map +1 -1
- package/dist/dropdownMenu/index.mjs +124 -164
- package/dist/dropdownMenu/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +3 -3
- package/dist/elements/index.d.ts +3 -3
- package/dist/elements/index.js +841 -1505
- package/dist/elements/index.mjs +381 -718
- package/dist/fileDropzone/index.js +60 -159
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +60 -159
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/glow/index.js +4 -16
- package/dist/glow/index.js.map +1 -1
- package/dist/glow/index.mjs +4 -16
- package/dist/glow/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -5
- package/dist/hooks/index.d.ts +1 -5
- package/dist/hooks/index.js +11 -24
- package/dist/hooks/index.mjs +2 -2
- package/dist/{index-B0aJcA6d.d.ts → index-BgNycocQ.d.mts} +2 -2
- package/dist/{index-B0aJcA6d.d.mts → index-BgNycocQ.d.ts} +2 -2
- package/dist/index.css +1 -6
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +1549 -2512
- package/dist/index.mjs +1550 -2516
- package/dist/input/index.js +20 -29
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +20 -29
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js +122 -163
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +122 -163
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/label/index.js +19 -26
- package/dist/label/index.js.map +1 -1
- package/dist/label/index.mjs +19 -26
- package/dist/label/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +2 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +434 -790
- package/dist/layout/index.mjs +143 -243
- package/dist/loading/index.js +30 -53
- package/dist/loading/index.js.map +1 -1
- package/dist/loading/index.mjs +30 -53
- package/dist/loading/index.mjs.map +1 -1
- package/dist/logos/index.js +66 -191
- package/dist/logos/index.js.map +1 -1
- package/dist/logos/index.mjs +66 -191
- package/dist/logos/index.mjs.map +1 -1
- package/dist/navbar/index.js +1 -4
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +1 -4
- package/dist/navbar/index.mjs.map +1 -1
- package/dist/navigationMenu/index.js +14 -22
- package/dist/navigationMenu/index.js.map +1 -1
- package/dist/navigationMenu/index.mjs +14 -22
- package/dist/navigationMenu/index.mjs.map +1 -1
- package/dist/pagination/index.js +1 -5
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs +1 -5
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/passwordInput/index.js +36 -65
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +36 -65
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +20 -29
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +20 -29
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.js +14 -16
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +14 -16
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/popover/index.js +14 -24
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/index.mjs +14 -24
- package/dist/popover/index.mjs.map +1 -1
- package/dist/progress/index.js +19 -26
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +19 -26
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progressCircle/index.js +67 -71
- package/dist/progressCircle/index.js.map +1 -1
- package/dist/progressCircle/index.mjs +67 -71
- package/dist/progressCircle/index.mjs.map +1 -1
- package/dist/radio/index.js +122 -163
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +122 -163
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.js.map +1 -1
- package/dist/scrollArea/index.mjs.map +1 -1
- package/dist/scrollIndicator/index.js +1 -4
- package/dist/scrollIndicator/index.js.map +1 -1
- package/dist/scrollIndicator/index.mjs +1 -4
- package/dist/scrollIndicator/index.mjs.map +1 -1
- package/dist/select/index.js +20 -29
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +20 -29
- package/dist/select/index.mjs.map +1 -1
- package/dist/separator/index.js.map +1 -1
- package/dist/separator/index.mjs.map +1 -1
- package/dist/sheet/index.js +42 -53
- package/dist/sheet/index.js.map +1 -1
- package/dist/sheet/index.mjs +42 -53
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/sidebar/index.js +66 -133
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/index.mjs +66 -133
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/signature/index.js +19 -26
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/index.mjs +19 -26
- package/dist/signature/index.mjs.map +1 -1
- package/dist/simpleTable/index.js +50 -81
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs +50 -81
- package/dist/simpleTable/index.mjs.map +1 -1
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sonner/index.js.map +1 -1
- package/dist/sonner/index.mjs.map +1 -1
- package/dist/sortButton/index.js +50 -82
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs +50 -82
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.js +214 -294
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +214 -294
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/stats/index.js +7 -35
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs +7 -35
- package/dist/stats/index.mjs.map +1 -1
- package/dist/switch/index.js +24 -34
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +24 -34
- package/dist/switch/index.mjs.map +1 -1
- package/dist/table/index.js +27 -29
- package/dist/table/index.js.map +1 -1
- package/dist/table/index.mjs +27 -29
- package/dist/table/index.mjs.map +1 -1
- package/dist/tabs/index.js +54 -76
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +54 -76
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.js +21 -38
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +21 -38
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/index.js +2 -10
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/index.mjs +2 -10
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toaster/index.js +3 -16
- package/dist/toaster/index.js.map +1 -1
- package/dist/toaster/index.mjs +3 -16
- package/dist/toaster/index.mjs.map +1 -1
- package/dist/tooltip/index.js +19 -26
- package/dist/tooltip/index.js.map +1 -1
- package/dist/tooltip/index.mjs +19 -26
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +12 -12
- package/dist/chunk-JP2N5WKD.mjs +0 -190
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/toaster/index.ts","../../elements/toaster/Toaster.tsx","../../util/index.ts","../../elements/toast/Toast.tsx"],"sourcesContent":["export * from \"./Toaster\";\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n ToasterToastProps,\n} from \"../toast\";\n\ntype ToasterProps = {\n direction?: DirectionType;\n toasts?: ToasterToastProps[];\n};\n\nexport function Toaster(props: ToasterProps) {\n let isRTL = props.direction === \"rtl\";\n return (\n <ToastProvider swipeDirection={isRTL ? \"left\" : \"right\"}>\n {props.toasts?.map(function ({\n id,\n title,\n description,\n size = \"default\",\n action,\n ...toastProps\n }) {\n return (\n <Toast direction={props.direction} key={id} {...toastProps}>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-gap-2\",\n action && \"hawa-justify-between\",\n )}\n >\n <div className=\"hawa-flex hawa-h-full hawa-flex-col hawa-p-2 hawa-pe-0\">\n <ToastClose />\n </div>\n <div className=\"hawa-mx-0 hawa-h-auto hawa-max-h-full hawa-w-px hawa-bg-primary-foreground/10\"></div>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-justify-between hawa-gap-2\",\n { \"hawa-p-4\": size === \"default\", \"hawa-p-2\": size === \"sm\" },\n )}\n >\n <div className={\"hawa-grid hawa-gap-1 hawa-text-start\"}>\n {title && <ToastTitle size={size}>{title}</ToastTitle>}\n {description && (\n <ToastDescription size={size}>\n {description}\n </ToastDescription>\n )}\n </div>\n {action && (\n <div className=\"hawa-flex hawa-flex-col hawa-justify-center\">\n {action}\n </div>\n )}\n </div>\n </div>\n </Toast>\n );\n })}\n <ToastViewport\n className={cn(\"hawa-gap-2\", isRTL && \"hawa-fixed hawa-left-0\")}\n />\n </ToastProvider>\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;;;ACAlB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,YAAuB;AAEvB,sBAAiC;AAEjC,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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6BAAAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,EAAE,YAAY,SAAS,WAAW,YAAY,SAAS,KAAK;AAAA,UAC9D;AAAA;AAAA,QAEA,6BAAAA,QAAA,cAAC,SAAI,WAAW,0CACb,SAAS,6BAAAA,QAAA,cAAC,cAAW,QAAa,KAAM,GACxC,eACC,6BAAAA,QAAA,cAAC,oBAAiB,QACf,WACH,CAEJ;AAAA,QACC,UACC,6BAAAA,QAAA,cAAC,SAAI,WAAU,iDACZ,MACH;AAAA,MAEJ;AAAA,IACF,CACF;AAAA,EAEJ,IACA,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,cAAc,SAAS,wBAAwB;AAAA;AAAA,EAC/D,CACF;AAEJ;","names":["React"]}
|
1
|
+
{"version":3,"sources":["../../elements/toaster/index.ts","../../elements/toaster/Toaster.tsx","../../util/index.ts","../../elements/toast/Toast.tsx"],"sourcesContent":["export * from \"./Toaster\";\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n ToasterToastProps,\n} from \"../toast\";\n\ntype ToasterProps = {\n direction?: DirectionType;\n toasts?: ToasterToastProps[];\n};\n\nexport function Toaster(props: ToasterProps) {\n let isRTL = props.direction === \"rtl\";\n return (\n <ToastProvider swipeDirection={isRTL ? \"left\" : \"right\"}>\n {props.toasts?.map(function ({\n id,\n title,\n description,\n size = \"default\",\n action,\n ...toastProps\n }) {\n return (\n <Toast direction={props.direction} key={id} {...toastProps}>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-gap-2\",\n action && \"hawa-justify-between\",\n )}\n >\n <div className=\"hawa-flex hawa-h-full hawa-flex-col hawa-p-2 hawa-pe-0\">\n <ToastClose />\n </div>\n <div className=\"hawa-mx-0 hawa-h-auto hawa-max-h-full hawa-w-px hawa-bg-primary-foreground/10\"></div>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-justify-between hawa-gap-2\",\n { \"hawa-p-4\": size === \"default\", \"hawa-p-2\": size === \"sm\" },\n )}\n >\n <div className={\"hawa-grid hawa-gap-1 hawa-text-start\"}>\n {title && <ToastTitle size={size}>{title}</ToastTitle>}\n {description && <ToastDescription size={size}>{description}</ToastDescription>}\n </div>\n {action && (\n <div className=\"hawa-flex hawa-flex-col hawa-justify-center\">{action}</div>\n )}\n </div>\n </div>\n </Toast>\n );\n })}\n <ToastViewport className={cn(\"hawa-gap-2\", isRTL && \"hawa-fixed hawa-left-0\")} />\n </ToastProvider>\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(sanitizedHex);\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\"),\n },\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49,\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport * as 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: \"hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning\",\n error: \"hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white\",\n success: \"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(\"hawa-select-text hawa-text-sm hawa-font-semibold\", sizeStyles[size], className)}\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(\"hawa-select-text hawa-opacity-90\", sizeStyles[size], className)}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;;;ACAlB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,YAAuB;AAEvB,sBAAiC;AAEjC,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,SAAS;AAAA,QACT,OAAO;AAAA,QACP,SAAS;AAAA,QACT,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;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,cAAc,cAA8B,yBAAS;AAErD,IAAM,QAAc,iBAMlB,CAAC,EAAE,WAAW,SAAS,WAAW,QAAQ,WAAW,GAAG,MAAM,GAAG,QAAQ;AACzE,SACE;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,cAAc,EAAE,SAAS,SAAS,CAAC;AAAA,QACnC;AAAA,QACA,cAAc,QACV,oDACA;AAAA,MACN;AAAA,MACA,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var ToastTitle = React.forwardRef(({ className, size = "default", ...props }, re
|
|
124
124
|
ToastPrimitives.Title,
|
125
125
|
{
|
126
126
|
ref,
|
127
|
-
className: cn(
|
128
|
-
"hawa-select-text hawa-text-sm hawa-font-semibold",
|
129
|
-
sizeStyles[size],
|
130
|
-
className
|
131
|
-
),
|
127
|
+
className: cn("hawa-select-text hawa-text-sm hawa-font-semibold", sizeStyles[size], className),
|
132
128
|
...props
|
133
129
|
}
|
134
130
|
));
|
@@ -137,11 +133,7 @@ var ToastDescription = React.forwardRef(({ className, size = "default", ...props
|
|
137
133
|
ToastPrimitives.Description,
|
138
134
|
{
|
139
135
|
ref,
|
140
|
-
className: cn(
|
141
|
-
"hawa-select-text hawa-opacity-90",
|
142
|
-
sizeStyles[size],
|
143
|
-
className
|
144
|
-
),
|
136
|
+
className: cn("hawa-select-text hawa-opacity-90", sizeStyles[size], className),
|
145
137
|
...props
|
146
138
|
}
|
147
139
|
));
|
@@ -181,12 +173,7 @@ function Toaster(props) {
|
|
181
173
|
action && /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-justify-center" }, action)
|
182
174
|
)
|
183
175
|
));
|
184
|
-
}), /* @__PURE__ */ React2.createElement(
|
185
|
-
ToastViewport,
|
186
|
-
{
|
187
|
-
className: cn("hawa-gap-2", isRTL && "hawa-fixed hawa-left-0")
|
188
|
-
}
|
189
|
-
));
|
176
|
+
}), /* @__PURE__ */ React2.createElement(ToastViewport, { className: cn("hawa-gap-2", isRTL && "hawa-fixed hawa-left-0") }));
|
190
177
|
}
|
191
178
|
export {
|
192
179
|
Toaster
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/toaster/Toaster.tsx","../../util/index.ts","../../elements/toast/Toast.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n ToasterToastProps,\n} from \"../toast\";\n\ntype ToasterProps = {\n direction?: DirectionType;\n toasts?: ToasterToastProps[];\n};\n\nexport function Toaster(props: ToasterProps) {\n let isRTL = props.direction === \"rtl\";\n return (\n <ToastProvider swipeDirection={isRTL ? \"left\" : \"right\"}>\n {props.toasts?.map(function ({\n id,\n title,\n description,\n size = \"default\",\n action,\n ...toastProps\n }) {\n return (\n <Toast direction={props.direction} key={id} {...toastProps}>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-gap-2\",\n action && \"hawa-justify-between\",\n )}\n >\n <div className=\"hawa-flex hawa-h-full hawa-flex-col hawa-p-2 hawa-pe-0\">\n <ToastClose />\n </div>\n <div className=\"hawa-mx-0 hawa-h-auto hawa-max-h-full hawa-w-px hawa-bg-primary-foreground/10\"></div>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-justify-between hawa-gap-2\",\n { \"hawa-p-4\": size === \"default\", \"hawa-p-2\": size === \"sm\" },\n )}\n >\n <div className={\"hawa-grid hawa-gap-1 hawa-text-start\"}>\n {title && <ToastTitle size={size}>{title}</ToastTitle>}\n {description && (\n <ToastDescription size={size}>\n {description}\n </ToastDescription>\n )}\n </div>\n {action && (\n <div className=\"hawa-flex hawa-flex-col hawa-justify-center\">\n {action}\n </div>\n )}\n </div>\n </div>\n </Toast>\n );\n })}\n <ToastViewport\n className={cn(\"hawa-gap-2\", isRTL && \"hawa-fixed hawa-left-0\")}\n />\n </ToastProvider>\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * 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"],"mappings":";;;AAAA,OAAOA,YAAW;;;ACAlB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,YAAY,WAAW;AAEvB,YAAY,qBAAqB;AAEjC,SAAS,WAA8B;AAIvC,IAAM,gBAAgB;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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C;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,EAAE,YAAY,SAAS,WAAW,YAAY,SAAS,KAAK;AAAA,UAC9D;AAAA;AAAA,QAEA,gBAAAA,OAAA,cAAC,SAAI,WAAW,0CACb,SAAS,gBAAAA,OAAA,cAAC,cAAW,QAAa,KAAM,GACxC,eACC,gBAAAA,OAAA,cAAC,oBAAiB,QACf,WACH,CAEJ;AAAA,QACC,UACC,gBAAAA,OAAA,cAAC,SAAI,WAAU,iDACZ,MACH;AAAA,MAEJ;AAAA,IACF,CACF;AAAA,EAEJ,IACA,gBAAAA,OAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,cAAc,SAAS,wBAAwB;AAAA;AAAA,EAC/D,CACF;AAEJ;","names":["React","React"]}
|
1
|
+
{"version":3,"sources":["../../elements/toaster/Toaster.tsx","../../util/index.ts","../../elements/toast/Toast.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n ToasterToastProps,\n} from \"../toast\";\n\ntype ToasterProps = {\n direction?: DirectionType;\n toasts?: ToasterToastProps[];\n};\n\nexport function Toaster(props: ToasterProps) {\n let isRTL = props.direction === \"rtl\";\n return (\n <ToastProvider swipeDirection={isRTL ? \"left\" : \"right\"}>\n {props.toasts?.map(function ({\n id,\n title,\n description,\n size = \"default\",\n action,\n ...toastProps\n }) {\n return (\n <Toast direction={props.direction} key={id} {...toastProps}>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-gap-2\",\n action && \"hawa-justify-between\",\n )}\n >\n <div className=\"hawa-flex hawa-h-full hawa-flex-col hawa-p-2 hawa-pe-0\">\n <ToastClose />\n </div>\n <div className=\"hawa-mx-0 hawa-h-auto hawa-max-h-full hawa-w-px hawa-bg-primary-foreground/10\"></div>\n <div\n className={cn(\n \"hawa-flex hawa-w-full hawa-flex-row hawa-justify-between hawa-gap-2\",\n { \"hawa-p-4\": size === \"default\", \"hawa-p-2\": size === \"sm\" },\n )}\n >\n <div className={\"hawa-grid hawa-gap-1 hawa-text-start\"}>\n {title && <ToastTitle size={size}>{title}</ToastTitle>}\n {description && <ToastDescription size={size}>{description}</ToastDescription>}\n </div>\n {action && (\n <div className=\"hawa-flex hawa-flex-col hawa-justify-center\">{action}</div>\n )}\n </div>\n </div>\n </Toast>\n );\n })}\n <ToastViewport className={cn(\"hawa-gap-2\", isRTL && \"hawa-fixed hawa-left-0\")} />\n </ToastProvider>\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(sanitizedHex);\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\"),\n },\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49,\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport * as 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: \"hawa-warning hawa-group hawa-text-warning-foreground hawa-bg-warning\",\n error: \"hawa-error hawa-group hawa-border-error hawa-bg-error hawa-text-white\",\n success: \"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(\"hawa-select-text hawa-text-sm hawa-font-semibold\", sizeStyles[size], className)}\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(\"hawa-select-text hawa-opacity-90\", sizeStyles[size], className)}\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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AA8B,4BAAY;;;AFvIpD,SAAS,QAAQ,OAAqB;AArB7C;AAsBE,MAAI,QAAQ,MAAM,cAAc;AAChC,SACE,gBAAAC,OAAA,cAAC,iBAAc,gBAAgB,QAAQ,SAAS,YAC7C,WAAM,WAAN,mBAAc,IAAI,SAAU;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,GAAG;AAAA,EACL,GAAG;AACD,WACE,gBAAAA,OAAA,cAAC,SAAM,WAAW,MAAM,WAAW,KAAK,IAAK,GAAG,cAC9C,gBAAAA,OAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,UAAU;AAAA,QACZ;AAAA;AAAA,MAEA,gBAAAA,OAAA,cAAC,SAAI,WAAU,4DACb,gBAAAA,OAAA,cAAC,gBAAW,CACd;AAAA,MACA,gBAAAA,OAAA,cAAC,SAAI,WAAU,iFAAgF;AAAA,MAC/F,gBAAAA,OAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,EAAE,YAAY,SAAS,WAAW,YAAY,SAAS,KAAK;AAAA,UAC9D;AAAA;AAAA,QAEA,gBAAAA,OAAA,cAAC,SAAI,WAAW,0CACb,SAAS,gBAAAA,OAAA,cAAC,cAAW,QAAa,KAAM,GACxC,eAAe,gBAAAA,OAAA,cAAC,oBAAiB,QAAa,WAAY,CAC7D;AAAA,QACC,UACC,gBAAAA,OAAA,cAAC,SAAI,WAAU,iDAA+C,MAAO;AAAA,MAEzE;AAAA,IACF,CACF;AAAA,EAEJ,IACA,gBAAAA,OAAA,cAAC,iBAAc,WAAW,GAAG,cAAc,SAAS,wBAAwB,GAAG,CACjF;AAEJ;","names":["React","React"]}
|
package/dist/tooltip/index.js
CHANGED
@@ -81,38 +81,31 @@ var Tooltip = ({
|
|
81
81
|
delayDuration = 300,
|
82
82
|
...props
|
83
83
|
}) => {
|
84
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
85
|
-
TooltipPrimitive.
|
84
|
+
return /* @__PURE__ */ import_react.default.createElement(TooltipPrimitive.TooltipProvider, { delayDuration, ...providerProps }, /* @__PURE__ */ import_react.default.createElement(
|
85
|
+
TooltipPrimitive.Root,
|
86
86
|
{
|
87
|
-
|
88
|
-
|
87
|
+
open: !disabled && open,
|
88
|
+
defaultOpen,
|
89
|
+
onOpenChange,
|
90
|
+
...props
|
89
91
|
},
|
92
|
+
/* @__PURE__ */ import_react.default.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
90
93
|
/* @__PURE__ */ import_react.default.createElement(
|
91
|
-
|
94
|
+
TooltipContent,
|
92
95
|
{
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
...
|
96
|
+
size,
|
97
|
+
side,
|
98
|
+
align: "center",
|
99
|
+
...contentProps,
|
100
|
+
style: {
|
101
|
+
...contentProps == null ? void 0 : contentProps.style,
|
102
|
+
maxWidth: "var(--radix-tooltip-content-available-width)",
|
103
|
+
maxHeight: "var(--radix-tooltip-content-available-height)"
|
104
|
+
}
|
97
105
|
},
|
98
|
-
|
99
|
-
/* @__PURE__ */ import_react.default.createElement(
|
100
|
-
TooltipContent,
|
101
|
-
{
|
102
|
-
size,
|
103
|
-
side,
|
104
|
-
align: "center",
|
105
|
-
...contentProps,
|
106
|
-
style: {
|
107
|
-
...contentProps == null ? void 0 : contentProps.style,
|
108
|
-
maxWidth: "var(--radix-tooltip-content-available-width)",
|
109
|
-
maxHeight: "var(--radix-tooltip-content-available-height)"
|
110
|
-
}
|
111
|
-
},
|
112
|
-
content
|
113
|
-
)
|
106
|
+
content
|
114
107
|
)
|
115
|
-
);
|
108
|
+
));
|
116
109
|
};
|
117
110
|
// Annotate the CommonJS export names for ESM import in node:
|
118
111
|
0 && (module.exports = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/tooltip/index.ts","../../elements/tooltip/Tooltip.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Tooltip\";\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider
|
1
|
+
{"version":3,"sources":["../../elements/tooltip/index.ts","../../elements/tooltip/Tooltip.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Tooltip\";\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider delayDuration={delayDuration} {...providerProps}>\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>{children}</TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import { 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(sanitizedHex);\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 +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BAAjB,EAA0B,GAAG,gBAAe,QAAS;AAAA,IACtD,6BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,OAAM;AAAA,QACL,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,GAAG,6CAAc;AAAA,UACjB,UAAU;AAAA,UACV,WAAW;AAAA,QACb;AAAA;AAAA,MAEC;AAAA,IACH;AAAA,EACF,CACF;AAEJ;","names":["React"]}
|
package/dist/tooltip/index.mjs
CHANGED
@@ -46,38 +46,31 @@ var Tooltip = ({
|
|
46
46
|
delayDuration = 300,
|
47
47
|
...props
|
48
48
|
}) => {
|
49
|
-
return /* @__PURE__ */ React.createElement(
|
50
|
-
TooltipPrimitive.
|
49
|
+
return /* @__PURE__ */ React.createElement(TooltipPrimitive.TooltipProvider, { delayDuration, ...providerProps }, /* @__PURE__ */ React.createElement(
|
50
|
+
TooltipPrimitive.Root,
|
51
51
|
{
|
52
|
-
|
53
|
-
|
52
|
+
open: !disabled && open,
|
53
|
+
defaultOpen,
|
54
|
+
onOpenChange,
|
55
|
+
...props
|
54
56
|
},
|
57
|
+
/* @__PURE__ */ React.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
55
58
|
/* @__PURE__ */ React.createElement(
|
56
|
-
|
59
|
+
TooltipContent,
|
57
60
|
{
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
...
|
61
|
+
size,
|
62
|
+
side,
|
63
|
+
align: "center",
|
64
|
+
...contentProps,
|
65
|
+
style: {
|
66
|
+
...contentProps == null ? void 0 : contentProps.style,
|
67
|
+
maxWidth: "var(--radix-tooltip-content-available-width)",
|
68
|
+
maxHeight: "var(--radix-tooltip-content-available-height)"
|
69
|
+
}
|
62
70
|
},
|
63
|
-
|
64
|
-
/* @__PURE__ */ React.createElement(
|
65
|
-
TooltipContent,
|
66
|
-
{
|
67
|
-
size,
|
68
|
-
side,
|
69
|
-
align: "center",
|
70
|
-
...contentProps,
|
71
|
-
style: {
|
72
|
-
...contentProps == null ? void 0 : contentProps.style,
|
73
|
-
maxWidth: "var(--radix-tooltip-content-available-width)",
|
74
|
-
maxHeight: "var(--radix-tooltip-content-available-height)"
|
75
|
-
}
|
76
|
-
},
|
77
|
-
content
|
78
|
-
)
|
71
|
+
content
|
79
72
|
)
|
80
|
-
);
|
73
|
+
));
|
81
74
|
};
|
82
75
|
export {
|
83
76
|
Tooltip
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/tooltip/Tooltip.tsx","../../util/index.ts"],"sourcesContent":["import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider
|
1
|
+
{"version":3,"sources":["../../elements/tooltip/Tooltip.tsx","../../util/index.ts"],"sourcesContent":["import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider delayDuration={delayDuration} {...providerProps}>\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>{children}</TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import { 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(sanitizedHex);\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,OAAO,WAAW;AAElB,YAAY,sBAAsB;;;ACFlC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADEA,IAAM,iBAAiB,MAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,gBAAgB,SAAS;AAAA,QACzB,gBAAgB,SAAS;AAAA,MAC3B;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;AAEtD,IAAM,eAAe,MAAM,WAGzB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oCAAkB,wBAAjB,EAAuB,KAAU,WAAW,GAAG,SAAS,GAAI,GAAG,OAAO,CACxE;AACD,aAAa,cAA+B,uBAAM;AA0BlD,IAAM,UAAiD,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,GAAG;AACL,MAAM;AACJ,SACE,oCAAkB,kCAAjB,EAAiC,eAA+B,GAAG,iBAClE;AAAA,IAAkB;AAAA,IAAjB;AAAA,MACC,MAAM,CAAC,YAAY;AAAA,MACnB;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,IAEJ,oCAAkB,0BAAjB,EAA0B,GAAG,gBAAe,QAAS;AAAA,IACtD;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,OAAM;AAAA,QACL,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,GAAG,6CAAc;AAAA,UACjB,UAAU;AAAA,UACV,WAAW;AAAA,QACb;AAAA;AAAA,MAEC;AAAA,IACH;AAAA,EACF,CACF;AAEJ;","names":[]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sikka/hawa",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.49.0-next",
|
4
4
|
"description": "Modern UI Kit made with Tailwind",
|
5
5
|
"author": {
|
6
6
|
"name": "Sikka Software",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"react-dom": "18.3.1"
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
|
-
"@headlessui/react": "^2.1.
|
51
|
+
"@headlessui/react": "^2.1.3",
|
52
52
|
"@hookform/resolvers": "^3.9.0",
|
53
53
|
"@radix-ui/react-accordion": "^1.2.0",
|
54
54
|
"@radix-ui/react-checkbox": "^1.1.1",
|
@@ -71,10 +71,10 @@
|
|
71
71
|
"clsx": "^2.1.1",
|
72
72
|
"cmdk": "^1.0.0",
|
73
73
|
"date-fns": "^3.6.0",
|
74
|
-
"embla-carousel-auto-height": "^8.
|
75
|
-
"embla-carousel-react": "^8.
|
74
|
+
"embla-carousel-auto-height": "^8.2.0",
|
75
|
+
"embla-carousel-react": "^8.2.0",
|
76
76
|
"input-otp": "^1.2.4",
|
77
|
-
"libphonenumber-js": "^1.11.
|
77
|
+
"libphonenumber-js": "^1.11.7",
|
78
78
|
"prism-react-renderer": "^2.3.1",
|
79
79
|
"prismjs": "^1.29.0",
|
80
80
|
"react-day-picker": "^9.0.8",
|
@@ -82,9 +82,9 @@
|
|
82
82
|
"react-headless-pagination": "^1.1.6",
|
83
83
|
"react-hook-form": "^7.52.2",
|
84
84
|
"react-select": "^5.8.0",
|
85
|
-
"signature_pad": "^5.0.
|
85
|
+
"signature_pad": "^5.0.3",
|
86
86
|
"sonner": "^1.5.0",
|
87
|
-
"tailwind-merge": "^2.
|
87
|
+
"tailwind-merge": "^2.5.2",
|
88
88
|
"tailwind-variants": "^0.2.1",
|
89
89
|
"trim-canvas": "^0.1.2",
|
90
90
|
"zod": "^3.23.8"
|
@@ -92,21 +92,21 @@
|
|
92
92
|
"devDependencies": {
|
93
93
|
"@babel/preset-react": "^7.24.7",
|
94
94
|
"@sikka/alam": "^0.0.4",
|
95
|
-
"@testing-library/jest-dom": "^6.
|
95
|
+
"@testing-library/jest-dom": "^6.5.0",
|
96
96
|
"@testing-library/react": "^16.0.0",
|
97
97
|
"@types/jest": "^29.5.12",
|
98
|
-
"@types/react": "^18.3.
|
98
|
+
"@types/react": "^18.3.4",
|
99
99
|
"@types/react-dom": "^18.3.0",
|
100
100
|
"autoprefixer": "^10.4.20",
|
101
101
|
"boxen": "^8.0.1",
|
102
102
|
"chalk": "^5.3.0",
|
103
|
-
"embla-carousel": "8.
|
103
|
+
"embla-carousel": "8.2.0",
|
104
104
|
"jest": "^29.7.0",
|
105
|
-
"lucide-react": "^0.
|
105
|
+
"lucide-react": "^0.435.0",
|
106
106
|
"postcss": "^8.4.41",
|
107
107
|
"postcss-cli": "^11.0.0",
|
108
108
|
"postcss-import": "^16.1.0",
|
109
|
-
"tailwindcss": "^3.4.
|
109
|
+
"tailwindcss": "^3.4.10",
|
110
110
|
"tailwindcss-animate": "^1.0.7",
|
111
111
|
"tsconfig-paths-webpack-plugin": "^4.1.0",
|
112
112
|
"tsup": "^8.2.4"
|