@sikka/hawa 0.41.0-next → 0.41.2-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.map +1 -1
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert/index.js +1 -1
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +1 -1
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.js +15 -15
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +15 -15
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appMenubar/index.js.map +1 -1
- package/dist/appMenubar/index.mjs.map +1 -1
- package/dist/appTabs/index.js +2 -2
- package/dist/appTabs/index.js.map +1 -1
- package/dist/appTabs/index.mjs +2 -2
- package/dist/appTabs/index.mjs.map +1 -1
- package/dist/appTopbar/index.js +5 -5
- package/dist/appTopbar/index.js.map +1 -1
- package/dist/appTopbar/index.mjs +5 -5
- package/dist/appTopbar/index.mjs.map +1 -1
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/backToTop/index.js +1 -1
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +1 -1
- 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 +1 -1
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/badge/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +15 -15
- package/dist/blocks/auth/index.mjs +13 -13
- package/dist/blocks/feedback/index.js +19 -19
- package/dist/blocks/feedback/index.mjs +17 -17
- package/dist/blocks/index.js +62 -62
- package/dist/blocks/index.mjs +46 -46
- package/dist/blocks/misc/index.js +17 -19
- package/dist/blocks/misc/index.mjs +11 -11
- package/dist/blocks/pricing/index.js +23 -23
- package/dist/blocks/pricing/index.mjs +21 -21
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/card/index.js +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/card/index.mjs.map +1 -1
- package/dist/carousel/index.d.mts +1 -1
- package/dist/carousel/index.d.ts +1 -1
- package/dist/carousel/index.js +7 -7
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +7 -7
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/{chunk-IS73LH5Y.mjs → chunk-2GEXJLRC.mjs} +1 -1
- package/dist/{chunk-FJXDCBMQ.mjs → chunk-7R25FOBM.mjs} +15 -15
- package/dist/{chunk-4ZELUQQ7.mjs → chunk-CQYG77SY.mjs} +1 -1
- package/dist/{chunk-NSMJTT6Y.mjs → chunk-D7HDVJFT.mjs} +3 -3
- package/dist/{chunk-ZSX2KZ2D.mjs → chunk-EBZECS2Z.mjs} +4 -4
- package/dist/{chunk-FK2C6C3B.mjs → chunk-FLMCWOQQ.mjs} +1 -1
- package/dist/{chunk-JGP3PSJL.mjs → chunk-FP6763YO.mjs} +4 -4
- package/dist/{chunk-UHUOBAEP.mjs → chunk-I3AK6DXN.mjs} +3 -3
- package/dist/{chunk-F6SLF6DS.mjs → chunk-K5S7P5ZO.mjs} +4 -4
- package/dist/{chunk-55TPME67.mjs → chunk-QNLA5TSV.mjs} +2 -2
- package/dist/codeBlock/index.js +5 -5
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +5 -5
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.js +7 -7
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +7 -7
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.js +5 -5
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +5 -5
- package/dist/command/index.mjs.map +1 -1
- package/dist/dataTable/index.js +6 -6
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +6 -6
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/destroyableCard/index.js +1 -1
- package/dist/destroyableCard/index.js.map +1 -1
- package/dist/destroyableCard/index.mjs +1 -1
- package/dist/destroyableCard/index.mjs.map +1 -1
- package/dist/dialog/index.js +4 -4
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +4 -4
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +7 -9
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +7 -9
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/docsSidebar/index.js +1 -1
- package/dist/docsSidebar/index.js.map +1 -1
- package/dist/docsSidebar/index.mjs +1 -1
- package/dist/docsSidebar/index.mjs.map +1 -1
- package/dist/dropdownMenu/index.js +3 -3
- package/dist/dropdownMenu/index.js.map +1 -1
- package/dist/dropdownMenu/index.mjs +3 -3
- package/dist/dropdownMenu/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +1 -1
- package/dist/elements/index.d.ts +1 -1
- package/dist/elements/index.js +55 -55
- package/dist/elements/index.mjs +40 -40
- package/dist/fileDropzone/index.js +5 -5
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +5 -5
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/glow/index.js.map +1 -1
- package/dist/glow/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +128 -128
- package/dist/index.mjs +128 -128
- package/dist/input/index.js +3 -3
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +3 -3
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js +4 -4
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +4 -4
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/label/index.js.map +1 -1
- package/dist/label/index.mjs.map +1 -1
- package/dist/layout/index.js +34 -36
- package/dist/layout/index.mjs +31 -31
- package/dist/loading/index.js.map +1 -1
- package/dist/loading/index.mjs.map +1 -1
- package/dist/navbar/index.js +12 -12
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +12 -12
- package/dist/navbar/index.mjs.map +1 -1
- package/dist/navigationMenu/index.js +5 -5
- package/dist/navigationMenu/index.js.map +1 -1
- package/dist/navigationMenu/index.mjs +5 -5
- package/dist/navigationMenu/index.mjs.map +1 -1
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/passwordInput/index.js +3 -3
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +3 -3
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +4 -4
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +4 -4
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progressCircle/index.js +1 -1
- package/dist/progressCircle/index.js.map +1 -1
- package/dist/progressCircle/index.mjs +1 -1
- package/dist/progressCircle/index.mjs.map +1 -1
- package/dist/radio/index.js +3 -3
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +3 -3
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.js +2 -2
- package/dist/scrollArea/index.js.map +1 -1
- package/dist/scrollArea/index.mjs +2 -2
- package/dist/scrollArea/index.mjs.map +1 -1
- package/dist/scrollIndicator/index.js.map +1 -1
- package/dist/scrollIndicator/index.mjs.map +1 -1
- package/dist/select/index.js +2 -2
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +2 -2
- 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 +1 -1
- package/dist/sheet/index.js.map +1 -1
- package/dist/sheet/index.mjs +1 -1
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/sidebar/index.js +5 -5
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/index.mjs +5 -5
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/index.mjs.map +1 -1
- package/dist/simpleTable/index.js +1 -1
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs +1 -1
- package/dist/simpleTable/index.mjs.map +1 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.d.mts +27 -27
- package/dist/splitButton/index.d.ts +27 -27
- package/dist/splitButton/index.js +750 -750
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +752 -752
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/stats/index.js +3 -5
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs +3 -5
- package/dist/stats/index.mjs.map +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +1 -1
- package/dist/switch/index.mjs.map +1 -1
- package/dist/tabs/index.js +2 -2
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +2 -2
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +1 -1
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/index.mjs +1 -1
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toaster/index.js +2 -2
- package/dist/toaster/index.js.map +1 -1
- package/dist/toaster/index.mjs +2 -2
- package/dist/toaster/index.mjs.map +1 -1
- package/dist/tooltip/index.js.map +1 -1
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/backToTop/index.mjs
CHANGED
@@ -541,7 +541,7 @@ var BackToTop = ({ ...props }) => {
|
|
541
541
|
"svg",
|
542
542
|
{
|
543
543
|
className: cn(
|
544
|
-
"hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all
|
544
|
+
"hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all disabled:hawa-bg-gray-200"
|
545
545
|
),
|
546
546
|
"aria-label": "Arrow Icon",
|
547
547
|
viewBox: "0 0 20 20",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/backToTop/BackToTop.tsx","../../util/index.ts","../../elements/button/Button.tsx","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/loading/Loading.tsx"],"sourcesContent":["import React, { FC, RefObject, useState, useEffect, useRef } from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { Button } from \"../button\";\n\ntype BackToTopTypes = {\n /** Horizontal padding relative to the attached corner */\n paddingX?: number;\n /** Vertical padding relative to the attached corner */\n paddingY?: number;\n /** Increase to the threshold of the scroll value that has to be passed for the button to appear */\n paddingThreshold?: number;\n corner?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n anchor: RefObject<HTMLInputElement>;\n};\n\nexport const BackToTop: FC<BackToTopTypes> = ({ ...props }) => {\n const [visible, setVisible] = useState<boolean>(false);\n const [rect, _setRect] = useState<DOMRect | null>(null);\n const self = useRef<HTMLButtonElement>(null);\n const _rect = useRef(rect);\n const setRect = (data: any) => {\n _rect.current = data;\n _setRect(data);\n };\n\n const getCoords = () => {\n let anchor = props.anchor.current;\n if (anchor) {\n return [anchor.scrollTop, anchor.scrollLeft];\n }\n return [0, 0];\n };\n\n const onScroll = () => {\n let [scrollTop, scrollLeft] = getCoords();\n let rect = props.anchor.current?.getBoundingClientRect();\n if (rect) {\n setVisible(scrollTop >= rect.height + (props.paddingThreshold || 100));\n }\n };\n\n const backToTop = () => {\n if (props.anchor.current) {\n props.anchor.current.scrollTo({ top: 0, behavior: \"smooth\" });\n }\n };\n\n // FIXME: Observers and listeners run twice\n useEffect(() => {\n if (!props.anchor.current) return;\n\n props.anchor.current.addEventListener(\"scroll\", onScroll);\n\n // Listens to rect changes. Alternatives like ResizeObserver & IntersectionObserver fail to detect positional changes consistently\n let interval = setInterval(() => {\n if (!props.anchor.current) return;\n\n let newRect = props.anchor.current.getBoundingClientRect();\n if (_rect.current == null) return setRect(newRect);\n\n if (\n !(\n _rect.current.top == newRect.top &&\n _rect.current.left == newRect.left &&\n _rect.current.width == newRect.width &&\n _rect.current.height == newRect.height\n )\n ) {\n setRect(newRect);\n }\n }, 1);\n\n return () => {\n props.anchor.current?.removeEventListener(\"scroll\", onScroll);\n clearInterval(interval);\n };\n }, [onScroll, props.anchor]);\n\n const getStyles = () => {\n if (!props.anchor.current || !self.current) return {};\n\n let corner = props.corner || \"bottom-right\";\n let [vertical, horizontal] = corner.split(\"-\");\n\n let anchorRect = props.anchor.current.getBoundingClientRect();\n let selfRect = self.current?.getBoundingClientRect();\n\n let width = horizontal == \"right\" ? anchorRect.width - selfRect.width : 0;\n let height = vertical == \"bottom\" ? anchorRect.height - selfRect.height : 0;\n\n let style = {\n top:\n anchorRect.y +\n height +\n (vertical == \"bottom\" ? -1 : 1) * (props.paddingX || 10),\n left:\n anchorRect.x +\n width +\n (horizontal == \"right\" ? -1 : 1) * (props.paddingX || 25)\n };\n\n return style;\n };\n\n return (\n <Button\n className={cn(\n \"hawa-fixed hawa-cursor-pointer hawa-rounded hawa-transition-all\",\n visible\n ? \"hawa-pointer-events-all hawa-opacity-100\"\n : \"hawa-pointer-events-none hawa-opacity-0\"\n )}\n onClick={backToTop}\n style={{\n ...getStyles(),\n transitionProperty: \"opacity, background-color\"\n }}\n ref={self}\n size=\"icon\"\n >\n <svg\n className={cn(\n \"hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all disabled:hawa-bg-gray-200\"\n )}\n aria-label=\"Arrow Icon\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"></path>\n </svg>\n </Button>\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 { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Loading } from \"../loading/Loading\";\n\nconst buttonVariants = cva(\n \"hawa-inline-flex hawa-items-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90\",\n light: \"hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40\",\n destructive:\n \"hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90\",\n outline:\n \"hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n secondary:\n \"hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80\",\n ghost: \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n link: \"hawa-text-primary hawa-underline-offset-4 hover:hawa-underline\",\n combobox: \"hawa-bg-background hawa-border\",\n neoBrutalism: \"neo-brutalism\",\n // \"hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active shadow-color-primary active:shadow-color-primary-active\",\n },\n size: {\n default: \"hawa-h-10 hawa-px-4 hawa-py-2\",\n heightless: \"hawa-px-4 hawa-py-4\",\n xs: \"hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 \",\n sm: \"hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3\",\n lg: \"hawa-h-11 hawa-rounded-md hawa-px-8\",\n xl: \"hawa-h-14 hawa-rounded-md hawa-px-10\",\n icon: \"hawa-h-10 hawa-w-10\",\n smallIcon: \"hawa-h-7 hawa-w-7\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"default\" },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n centered?: boolean;\n isLoading?: boolean;\n label?: string;\n labelProps?: LabelProps;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n showHelperText?: boolean;\n /**\n * If true, the button will include a label and helper text. This is useful for forms where the button is part of the form.\n */\n asInput?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n label,\n variant,\n size,\n asChild = false,\n centered = true,\n isLoading,\n children,\n labelProps,\n showHelperText = false,\n asInput = false,\n ...props\n },\n ref,\n ) => {\n const Comp = \"button\";\n\n // Determine the color for the Loading component based on the variant\n const loadingColor =\n variant === \"outline\" || variant === \"ghost\" || variant === \"neoBrutalism\"\n ? \"hawa-bg-primary\"\n : \"hawa-bg-primary-foreground\";\n\n if (asInput) {\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n {label && <Label {...labelProps}>{label}</Label>}\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n {showHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n } else {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n );\n }\n },\n);\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ helperText }: { helperText?: any }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n helperText ? \"hawa-h-4 hawa-opacity-100\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault()\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\"\n },\n className\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\"\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React, { FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype LoadingTypes = {\n /** Specifies the size of the loading component.*/\n size?: \"button\" | \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n /** Determines the design of the loading animation.*/\n design?:\n | \"spinner\"\n | \"dots-bounce\"\n | \"dots-pulse\"\n | \"pulse\"\n | \"spinner-dots\"\n | \"squircle\"\n | \"square\"\n | \"progress\"\n | \"orbit\";\n /** Specifies the color of the loading component. By default it will inherit the value of --primary global CSS variable*/\n color?: string;\n classNames?: {\n container?: string;\n track?: string;\n car?: string;\n };\n themeMode?: \"dark\" | \"light\";\n};\n\nexport const Loading: FC<LoadingTypes> = ({\n design = \"spinner\",\n size = \"normal\",\n themeMode = \"light\",\n classNames,\n color,\n ...props\n}) => {\n let sizeStyles = {\n button: \"hawa-h-4 hawa-w-4\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"hawa-h-8 hawa-w-8\",\n lg: \"hawa-h-14 hawa-w-14\",\n xl: \"hawa-h-24 hawa-w-24\"\n };\n let progressSizes = {\n button: \"hawa-h-1\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"\",\n lg: \"hawa-h-6\",\n xl: \"hawa-h-10 hawa-w-64\"\n };\n\n let animationStyles: any = {\n pulse: \"hawa-animate-in hawa-fade-in hawa-duration-1000\",\n bounce: \"hawa-animate-bounce\"\n };\n switch (design.split(\"-\")[0]) {\n case \"dots\":\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-row hawa-gap-2\",\n classNames?.container\n )}\n >\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\"\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\"\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\"\n )}\n ></div>\n </div>\n );\n case \"square\":\n return (\n <svg\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container\n )}\n viewBox=\"0 0 35 35\"\n height=\"35\"\n width=\"35\"\n >\n <rect\n className=\"squircle-track\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n />\n <rect\n className=\"square-car\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n pathLength=\"100\"\n />\n </svg>\n );\n case \"squircle\":\n return (\n <svg\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 37 37\"\n height=\"37\"\n width=\"37\"\n preserveAspectRatio=\"xMidYMid meet\"\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container\n )}\n >\n <path\n className={cn(\"squircle-track\", classNames?.track)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n d=\"M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5\"\n ></path>\n <path\n className={cn(\"squircle-car\", classNames?.car)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n d=\"M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5\"\n ></path>\n </svg>\n );\n case \"progress\":\n return (\n <div\n className={cn(\n \"progress-loading after:hawa-rounded hawa-rounded\",\n progressSizes[size],\n classNames?.container\n )}\n ></div>\n );\n case \"orbit\":\n return (\n <div className={cn(\"orbit-container\", classNames?.container)}></div>\n );\n\n default:\n return (\n <svg\n viewBox=\"0 0 40 40\"\n height=\"40\"\n width=\"40\"\n className={cn(\n \"circle-container\",\n sizeStyles[size],\n classNames?.container\n )}\n >\n <circle\n className={cn(\n \"circle-track\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\"\n },\n classNames?.track\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n pathLength=\"100\"\n />\n <circle\n className={cn(\n \"circle-car\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\"\n },\n classNames?.car\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n pathLength=\"100\"\n strokeWidth=\"5px\"\n />\n </svg>\n );\n }\n};\n"],"mappings":";;;AAAA,OAAOA,UAAwB,UAAU,WAAW,cAAc;;;ACAlE,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,YAAYC,YAAW;AAGvB,SAAS,WA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AA,MACT,OAAO;AAAA,QACL,GAAG,UAAU;AAAA,QACb,oBAAoB;AAAA,MACtB;AAAA,MACA,KAAK;AAAA,MACL,MAAK;AAAA;AAAA,IAEL,gBAAAA,OAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,QACF;AAAA,QACA,cAAW;AAAA,QACX,SAAQ;AAAA,QACR,MAAK;AAAA;AAAA,MAEL,gBAAAA,OAAA,cAAC,UAAK,GAAE,sHAAqH;AAAA,IAC/H;AAAA,EACF;AAEJ;","names":["React","React","React","React","React","React","React","rect","React"]}
|
1
|
+
{"version":3,"sources":["../../elements/backToTop/BackToTop.tsx","../../util/index.ts","../../elements/button/Button.tsx","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/loading/Loading.tsx"],"sourcesContent":["import React, { FC, RefObject, useState, useEffect, useRef } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { Button } from \"../button\";\n\ntype BackToTopTypes = {\n /** Horizontal padding relative to the attached corner */\n paddingX?: number;\n /** Vertical padding relative to the attached corner */\n paddingY?: number;\n /** Increase to the threshold of the scroll value that has to be passed for the button to appear */\n paddingThreshold?: number;\n corner?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n anchor: RefObject<HTMLInputElement>;\n};\n\nexport const BackToTop: FC<BackToTopTypes> = ({ ...props }) => {\n const [visible, setVisible] = useState<boolean>(false);\n const [rect, _setRect] = useState<DOMRect | null>(null);\n const self = useRef<HTMLButtonElement>(null);\n const _rect = useRef(rect);\n const setRect = (data: any) => {\n _rect.current = data;\n _setRect(data);\n };\n\n const getCoords = () => {\n let anchor = props.anchor.current;\n if (anchor) {\n return [anchor.scrollTop, anchor.scrollLeft];\n }\n return [0, 0];\n };\n\n const onScroll = () => {\n let [scrollTop, scrollLeft] = getCoords();\n let rect = props.anchor.current?.getBoundingClientRect();\n if (rect) {\n setVisible(scrollTop >= rect.height + (props.paddingThreshold || 100));\n }\n };\n\n const backToTop = () => {\n if (props.anchor.current) {\n props.anchor.current.scrollTo({ top: 0, behavior: \"smooth\" });\n }\n };\n\n // FIXME: Observers and listeners run twice\n useEffect(() => {\n if (!props.anchor.current) return;\n\n props.anchor.current.addEventListener(\"scroll\", onScroll);\n\n // Listens to rect changes. Alternatives like ResizeObserver & IntersectionObserver fail to detect positional changes consistently\n let interval = setInterval(() => {\n if (!props.anchor.current) return;\n\n let newRect = props.anchor.current.getBoundingClientRect();\n if (_rect.current == null) return setRect(newRect);\n\n if (\n !(\n _rect.current.top == newRect.top &&\n _rect.current.left == newRect.left &&\n _rect.current.width == newRect.width &&\n _rect.current.height == newRect.height\n )\n ) {\n setRect(newRect);\n }\n }, 1);\n\n return () => {\n props.anchor.current?.removeEventListener(\"scroll\", onScroll);\n clearInterval(interval);\n };\n }, [onScroll, props.anchor]);\n\n const getStyles = () => {\n if (!props.anchor.current || !self.current) return {};\n\n let corner = props.corner || \"bottom-right\";\n let [vertical, horizontal] = corner.split(\"-\");\n\n let anchorRect = props.anchor.current.getBoundingClientRect();\n let selfRect = self.current?.getBoundingClientRect();\n\n let width = horizontal == \"right\" ? anchorRect.width - selfRect.width : 0;\n let height = vertical == \"bottom\" ? anchorRect.height - selfRect.height : 0;\n\n let style = {\n top:\n anchorRect.y +\n height +\n (vertical == \"bottom\" ? -1 : 1) * (props.paddingX || 10),\n left:\n anchorRect.x +\n width +\n (horizontal == \"right\" ? -1 : 1) * (props.paddingX || 25),\n };\n\n return style;\n };\n\n return (\n <Button\n className={cn(\n \"hawa-fixed hawa-cursor-pointer hawa-rounded hawa-transition-all\",\n visible\n ? \"hawa-pointer-events-all hawa-opacity-100\"\n : \"hawa-pointer-events-none hawa-opacity-0\",\n )}\n onClick={backToTop}\n style={{\n ...getStyles(),\n transitionProperty: \"opacity, background-color\",\n }}\n ref={self}\n size=\"icon\"\n >\n <svg\n className={cn(\n \"hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all disabled:hawa-bg-gray-200\",\n )}\n aria-label=\"Arrow Icon\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n >\n <path d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"></path>\n </svg>\n </Button>\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 { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Loading } from \"../loading/Loading\";\n\nconst buttonVariants = cva(\n \"hawa-inline-flex hawa-items-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90\",\n light: \"hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40\",\n destructive:\n \"hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90\",\n outline:\n \"hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n secondary:\n \"hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80\",\n ghost: \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n link: \"hawa-text-primary hawa-underline-offset-4 hover:hawa-underline\",\n combobox: \"hawa-bg-background hawa-border\",\n neoBrutalism: \"neo-brutalism\",\n // \"hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active shadow-color-primary active:shadow-color-primary-active\",\n },\n size: {\n default: \"hawa-h-10 hawa-px-4 hawa-py-2\",\n heightless: \"hawa-px-4 hawa-py-4\",\n xs: \"hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 \",\n sm: \"hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3\",\n lg: \"hawa-h-11 hawa-rounded-md hawa-px-8\",\n xl: \"hawa-h-14 hawa-rounded-md hawa-px-10\",\n icon: \"hawa-h-10 hawa-w-10\",\n smallIcon: \"hawa-h-7 hawa-w-7\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"default\" },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n centered?: boolean;\n isLoading?: boolean;\n label?: string;\n labelProps?: LabelProps;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n showHelperText?: boolean;\n /**\n * If true, the button will include a label and helper text. This is useful for forms where the button is part of the form.\n */\n asInput?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n label,\n variant,\n size,\n asChild = false,\n centered = true,\n isLoading,\n children,\n labelProps,\n showHelperText = false,\n asInput = false,\n ...props\n },\n ref,\n ) => {\n const Comp = \"button\";\n\n // Determine the color for the Loading component based on the variant\n const loadingColor =\n variant === \"outline\" || variant === \"ghost\" || variant === \"neoBrutalism\"\n ? \"hawa-bg-primary\"\n : \"hawa-bg-primary-foreground\";\n\n if (asInput) {\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n {label && <Label {...labelProps}>{label}</Label>}\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n {showHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n } else {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n );\n }\n },\n);\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ helperText }: { helperText?: any }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n helperText ? \"hawa-h-4 hawa-opacity-100\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React, { FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype LoadingTypes = {\n /** Specifies the size of the loading component.*/\n size?: \"button\" | \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n /** Determines the design of the loading animation.*/\n design?:\n | \"spinner\"\n | \"dots-bounce\"\n | \"dots-pulse\"\n | \"pulse\"\n | \"spinner-dots\"\n | \"squircle\"\n | \"square\"\n | \"progress\"\n | \"orbit\";\n /** Specifies the color of the loading component. By default it will inherit the value of --primary global CSS variable*/\n color?: string;\n classNames?: {\n container?: string;\n track?: string;\n car?: string;\n };\n themeMode?: \"dark\" | \"light\";\n};\n\nexport const Loading: FC<LoadingTypes> = ({\n design = \"spinner\",\n size = \"normal\",\n themeMode = \"light\",\n classNames,\n color,\n ...props\n}) => {\n let sizeStyles = {\n button: \"hawa-h-4 hawa-w-4\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"hawa-h-8 hawa-w-8\",\n lg: \"hawa-h-14 hawa-w-14\",\n xl: \"hawa-h-24 hawa-w-24\",\n };\n let progressSizes = {\n button: \"hawa-h-1\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"\",\n lg: \"hawa-h-6\",\n xl: \"hawa-h-10 hawa-w-64\",\n };\n\n let animationStyles: any = {\n pulse: \"hawa-animate-in hawa-fade-in hawa-duration-1000\",\n bounce: \"hawa-animate-bounce\",\n };\n switch (design.split(\"-\")[0]) {\n case \"dots\":\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-row hawa-gap-2\",\n classNames?.container,\n )}\n >\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n </div>\n );\n case \"square\":\n return (\n <svg\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n viewBox=\"0 0 35 35\"\n height=\"35\"\n width=\"35\"\n >\n <rect\n className=\"squircle-track\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n />\n <rect\n className=\"square-car\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n pathLength=\"100\"\n />\n </svg>\n );\n case \"squircle\":\n return (\n <svg\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 37 37\"\n height=\"37\"\n width=\"37\"\n preserveAspectRatio=\"xMidYMid meet\"\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n >\n <path\n className={cn(\"squircle-track\", classNames?.track)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n d=\"M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5\"\n ></path>\n <path\n className={cn(\"squircle-car\", classNames?.car)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n d=\"M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5\"\n ></path>\n </svg>\n );\n case \"progress\":\n return (\n <div\n className={cn(\n \"progress-loading after:hawa-rounded hawa-rounded\",\n progressSizes[size],\n classNames?.container,\n )}\n ></div>\n );\n case \"orbit\":\n return (\n <div className={cn(\"orbit-container\", classNames?.container)}></div>\n );\n\n default:\n return (\n <svg\n viewBox=\"0 0 40 40\"\n height=\"40\"\n width=\"40\"\n className={cn(\n \"circle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n >\n <circle\n className={cn(\n \"circle-track\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.track,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n pathLength=\"100\"\n />\n <circle\n className={cn(\n \"circle-car\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.car,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n pathLength=\"100\"\n strokeWidth=\"5px\"\n />\n </svg>\n );\n }\n};\n"],"mappings":";;;AAAA,OAAOA,UAAwB,UAAU,WAAW,cAAc;;;ACAlE,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,YAAYC,YAAW;AAGvB,SAAS,WAA8B;;;ACHvC,OAAO,WAAW;AAIX,IAAM,aAAa,CAAC,EAAE,WAAW,MACtC;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;ACZF,YAAYC,Y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AAA,QACA,cAAW;AAAA,QACX,SAAQ;AAAA,QACR,MAAK;AAAA;AAAA,MAEL,gBAAAA,OAAA,cAAC,UAAK,GAAE,sHAAqH;AAAA,IAC/H;AAAA,EACF;AAEJ;","names":["React","React","React","React","React","React","React","rect","React"]}
|
package/dist/badge/index.d.mts
CHANGED
@@ -8,6 +8,6 @@ type BadgeTypes = {
|
|
8
8
|
className?: string;
|
9
9
|
};
|
10
10
|
declare const Badge: FC<BadgeTypes>;
|
11
|
-
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React.JSX.Element;
|
11
|
+
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text, }: any) => React.JSX.Element;
|
12
12
|
|
13
13
|
export { Badge, BadgedComponent };
|
package/dist/badge/index.d.ts
CHANGED
@@ -8,6 +8,6 @@ type BadgeTypes = {
|
|
8
8
|
className?: string;
|
9
9
|
};
|
10
10
|
declare const Badge: FC<BadgeTypes>;
|
11
|
-
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React.JSX.Element;
|
11
|
+
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text, }: any) => React.JSX.Element;
|
12
12
|
|
13
13
|
export { Badge, BadgedComponent };
|
package/dist/badge/index.js
CHANGED
@@ -93,7 +93,7 @@ var Badge = ({
|
|
93
93
|
left: badgePosition == null ? void 0 : badgePosition.left
|
94
94
|
},
|
95
95
|
className: cn(
|
96
|
-
"hawa-origin-center hawa-rounded-full
|
96
|
+
"hawa-origin-center hawa-rounded-full hawa-bg-red-500",
|
97
97
|
sizeStyles[size].classes,
|
98
98
|
"hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-text-[9px] hawa-text-white"
|
99
99
|
)
|
package/dist/badge/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/badge/index.ts","../../elements/badge/Badge.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Badge\";\n","import React, { useEffect, useState, useRef, RefObject, FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype BadgeTypes = {\n position: \"right\" | \"left\";\n anchor: RefObject<HTMLElement>;\n size?: \"small\" | \"default\" | \"large\";\n text?: string | number;\n className?: string;\n};\n\nexport const Badge: FC<BadgeTypes> = ({\n anchor,\n position = \"right\",\n size = \"default\",\n text,\n className
|
1
|
+
{"version":3,"sources":["../../elements/badge/index.ts","../../elements/badge/Badge.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Badge\";\n","import React, { useEffect, useState, useRef, RefObject, FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype BadgeTypes = {\n position: \"right\" | \"left\";\n anchor: RefObject<HTMLElement>;\n size?: \"small\" | \"default\" | \"large\";\n text?: string | number;\n className?: string;\n};\n\nexport const Badge: FC<BadgeTypes> = ({\n anchor,\n position = \"right\",\n size = \"default\",\n text,\n className,\n}) => {\n const [badgePosition, setBadgePosition] = useState<any>(null);\n const indicatorRef = useRef(null);\n const sizeStyles = {\n small: { top: 4, left: 6, right: 7, classes: \"hawa-w-3 hawa-h-3\" },\n default: { top: 4, left: 7, right: 5, classes: \"hawa-w-3 hawa-h-3\" },\n large: { top: 6, left: 12, right: 7, classes: \"hawa-w-6 hawa-h-6\" },\n };\n useEffect(() => {\n const handlePositioning = () => {\n if (anchor.current && indicatorRef.current) {\n const rect = anchor.current.getBoundingClientRect();\n const parentRect = (\n indicatorRef.current as HTMLElement\n ).parentElement?.getBoundingClientRect();\n const style = window.getComputedStyle(anchor.current);\n const marginTop = parseFloat(style.marginTop.replace(\"px\", \"\"));\n const marginRight = parseFloat(style.marginRight.replace(\"px\", \"\"));\n\n if (parentRect) {\n setBadgePosition({\n top: rect.top - parentRect.top - marginTop - sizeStyles[size].top,\n left:\n position === \"right\"\n ? parentRect.right - parentRect.left - sizeStyles[size].left\n : rect.right -\n parentRect.left -\n parentRect.width -\n marginRight -\n sizeStyles[size].right,\n });\n }\n }\n };\n\n handlePositioning();\n window.addEventListener(\"resize\", handlePositioning);\n return () => {\n window.removeEventListener(\"resize\", handlePositioning);\n };\n }, [anchor]);\n\n return (\n <div ref={indicatorRef} className={cn(\"hawa-relative\", className)}>\n {badgePosition && (\n <div\n style={{\n position: \"absolute\",\n top: badgePosition?.top,\n left: badgePosition?.left,\n }}\n className={cn(\n \"hawa-origin-center hawa-rounded-full hawa-bg-red-500\",\n sizeStyles[size].classes,\n \"hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-text-[9px] hawa-text-white\",\n )}\n >\n {size === \"large\" && text && text}\n </div>\n )}\n </div>\n );\n};\n\nexport const BadgedComponent = ({\n children,\n className,\n hideBadge,\n position,\n size,\n text,\n}: any) => {\n const ref = useRef(null);\n\n return (\n <div className={cn(\"hawa-relative hawa-w-fit\", className)} ref={ref}>\n {!hideBadge && (\n <Badge\n size={size}\n text={text}\n position={position}\n anchor={ref}\n className=\"hawa-z-10\"\n />\n )}\n {children}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkE;;;ACAlE,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADOO,IAAM,QAAwB,CAAC;AAAA,EACpC;AAAA,EACA,WAAW;AAAA,EACX,OAAO;AAAA,EACP;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAc,IAAI;AAC5D,QAAM,mBAAe,qBAAO,IAAI;AAChC,QAAM,aAAa;AAAA,IACjB,OAAO,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,oBAAoB;AAAA,IACjE,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,oBAAoB;AAAA,IACnE,OAAO,EAAE,KAAK,GAAG,MAAM,IAAI,OAAO,GAA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AAAA,EACA;AAAA,EACA;AACF,MAAW;AACT,QAAM,UAAM,qBAAO,IAAI;AAEvB,SACE,6BAAAA,QAAA,cAAC,SAAI,WAAW,GAAG,4BAA4B,SAAS,GAAG,OACxD,CAAC,aACA,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,WAAU;AAAA;AAAA,EACZ,GAED,QACH;AAEJ;","names":["React"]}
|
package/dist/badge/index.mjs
CHANGED
@@ -57,7 +57,7 @@ var Badge = ({
|
|
57
57
|
left: badgePosition == null ? void 0 : badgePosition.left
|
58
58
|
},
|
59
59
|
className: cn(
|
60
|
-
"hawa-origin-center hawa-rounded-full
|
60
|
+
"hawa-origin-center hawa-rounded-full hawa-bg-red-500",
|
61
61
|
sizeStyles[size].classes,
|
62
62
|
"hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-text-[9px] hawa-text-white"
|
63
63
|
)
|
package/dist/badge/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/badge/Badge.tsx","../../util/index.ts"],"sourcesContent":["import React, { useEffect, useState, useRef, RefObject, FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype BadgeTypes = {\n position: \"right\" | \"left\";\n anchor: RefObject<HTMLElement>;\n size?: \"small\" | \"default\" | \"large\";\n text?: string | number;\n className?: string;\n};\n\nexport const Badge: FC<BadgeTypes> = ({\n anchor,\n position = \"right\",\n size = \"default\",\n text,\n className
|
1
|
+
{"version":3,"sources":["../../elements/badge/Badge.tsx","../../util/index.ts"],"sourcesContent":["import React, { useEffect, useState, useRef, RefObject, FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype BadgeTypes = {\n position: \"right\" | \"left\";\n anchor: RefObject<HTMLElement>;\n size?: \"small\" | \"default\" | \"large\";\n text?: string | number;\n className?: string;\n};\n\nexport const Badge: FC<BadgeTypes> = ({\n anchor,\n position = \"right\",\n size = \"default\",\n text,\n className,\n}) => {\n const [badgePosition, setBadgePosition] = useState<any>(null);\n const indicatorRef = useRef(null);\n const sizeStyles = {\n small: { top: 4, left: 6, right: 7, classes: \"hawa-w-3 hawa-h-3\" },\n default: { top: 4, left: 7, right: 5, classes: \"hawa-w-3 hawa-h-3\" },\n large: { top: 6, left: 12, right: 7, classes: \"hawa-w-6 hawa-h-6\" },\n };\n useEffect(() => {\n const handlePositioning = () => {\n if (anchor.current && indicatorRef.current) {\n const rect = anchor.current.getBoundingClientRect();\n const parentRect = (\n indicatorRef.current as HTMLElement\n ).parentElement?.getBoundingClientRect();\n const style = window.getComputedStyle(anchor.current);\n const marginTop = parseFloat(style.marginTop.replace(\"px\", \"\"));\n const marginRight = parseFloat(style.marginRight.replace(\"px\", \"\"));\n\n if (parentRect) {\n setBadgePosition({\n top: rect.top - parentRect.top - marginTop - sizeStyles[size].top,\n left:\n position === \"right\"\n ? parentRect.right - parentRect.left - sizeStyles[size].left\n : rect.right -\n parentRect.left -\n parentRect.width -\n marginRight -\n sizeStyles[size].right,\n });\n }\n }\n };\n\n handlePositioning();\n window.addEventListener(\"resize\", handlePositioning);\n return () => {\n window.removeEventListener(\"resize\", handlePositioning);\n };\n }, [anchor]);\n\n return (\n <div ref={indicatorRef} className={cn(\"hawa-relative\", className)}>\n {badgePosition && (\n <div\n style={{\n position: \"absolute\",\n top: badgePosition?.top,\n left: badgePosition?.left,\n }}\n className={cn(\n \"hawa-origin-center hawa-rounded-full hawa-bg-red-500\",\n sizeStyles[size].classes,\n \"hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-text-[9px] hawa-text-white\",\n )}\n >\n {size === \"large\" && text && text}\n </div>\n )}\n </div>\n );\n};\n\nexport const BadgedComponent = ({\n children,\n className,\n hideBadge,\n position,\n size,\n text,\n}: any) => {\n const ref = useRef(null);\n\n return (\n <div className={cn(\"hawa-relative hawa-w-fit\", className)} ref={ref}>\n {!hideBadge && (\n <Badge\n size={size}\n text={text}\n position={position}\n anchor={ref}\n className=\"hawa-z-10\"\n />\n )}\n {children}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;AAAA,OAAO,SAAS,WAAW,UAAU,cAA6B;;;ACAlE,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADOO,IAAM,QAAwB,CAAC;AAAA,EACpC;AAAA,EACA,WAAW;AAAA,EACX,OAAO;AAAA,EACP;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAc,IAAI;AAC5D,QAAM,eAAe,OAAO,IAAI;AAChC,QAAM,aAAa;AAAA,IACjB,OAAO,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,oBAAoB;AAAA,IACjE,SAAS,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,oBAAoB;AAAA,IACnE,OAAO,EAAE,KAAK,GAAG,MAAM,IAAI,OAAO,GAAG,SAAS,oBAAoB;AAAA,EACpE;AACA,YAAU,MAAM;AACd,UAAM,oBAAoB,MAAM;AA3BpC;AA4BM,UAAI,OAAO,WAAW,aAAa,SAAS;AAC1C,cAAM,OAAO,OAAO,QAAQ,sBAAsB;AAClD,cAAM,cACJ,kBAAa,QACb,kBADA,mBACe;AACjB,cAAM,QAAQ,OAAO,iBAAiB,OAAO,OAAO;AACpD,cAAM,YAAY,WAAW,MAAM,UAAU,QAAQ,MAAM,EAAE,CAAC;AAC9D,cAAM,cAAc,WAAW,MAAM,YAAY,QAAQ,MAAM,EAAE,CAAC;AAElE,YAAI,YAAY;AACd,2BAAiB;AAAA,YACf,KAAK,KAAK,MAAM,WAAW,MAAM,YAAY,WAAW,IAAI,EAAE;AAAA,YAC9D,MACE,aAAa,UACT,WAAW,QAAQ,WAAW,OAAO,WAAW,IAAI,EAAE,OACtD,KAAK,QACL,WAAW,OACX,WAAW,QACX,cACA,WAAW,IAAI,EAAE;AAAA,UACzB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAEA,sBAAkB;AAClB,WAAO,iBAAiB,UAAU,iBAAiB;AACnD,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,iBAAiB;AAAA,IACxD;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oCAAC,SAAI,KAAK,cAAc,WAAW,GAAG,iBAAiB,SAAS,KAC7D,iBACC;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,UAAU;AAAA,QACV,KAAK,+CAAe;AAAA,QACpB,MAAM,+CAAe;AAAA,MACvB;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,WAAW,IAAI,EAAE;AAAA,QACjB;AAAA,MACF;AAAA;AAAA,IAEC,SAAS,WAAW,QAAQ;AAAA,EAC/B,CAEJ;AAEJ;AAEO,IAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAW;AACT,QAAM,MAAM,OAAO,IAAI;AAEvB,SACE,oCAAC,SAAI,WAAW,GAAG,4BAA4B,SAAS,GAAG,OACxD,CAAC,aACA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,WAAU;AAAA;AAAA,EACZ,GAED,QACH;AAEJ;","names":[]}
|
@@ -1218,7 +1218,7 @@ var Alert = ({
|
|
1218
1218
|
"data-dismiss-target": "#alert-default",
|
1219
1219
|
"aria-label": "Close",
|
1220
1220
|
className: cn(
|
1221
|
-
"hawa-absolute
|
1221
|
+
"hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-9 hawa-w-9 hawa-items-center hawa-justify-center hawa-rounded-inner hawa-p-1.5 hawa-transition-all hover:hawa-text-gray-900",
|
1222
1222
|
closeButtonStyle[severity],
|
1223
1223
|
direction === "rtl" ? "hawa-left-2" : "hawa-right-2"
|
1224
1224
|
),
|
@@ -1309,7 +1309,7 @@ var CardTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
1309
1309
|
"h3",
|
1310
1310
|
{
|
1311
1311
|
ref,
|
1312
|
-
className: cn("hawa-text-2xl hawa-font-semibold
|
1312
|
+
className: cn("hawa-text-2xl hawa-font-semibold", className),
|
1313
1313
|
...props
|
1314
1314
|
}
|
1315
1315
|
));
|
@@ -1449,7 +1449,7 @@ var Input = (0, import_react8.forwardRef)(
|
|
1449
1449
|
)
|
1450
1450
|
},
|
1451
1451
|
props.label && /* @__PURE__ */ import_react8.default.createElement(Label, { ...labelProps }, props.label),
|
1452
|
-
/* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center
|
1452
|
+
/* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react8.default.createElement(
|
1453
1453
|
"span",
|
1454
1454
|
{
|
1455
1455
|
className: cn(
|
@@ -1515,7 +1515,7 @@ var Input = (0, import_react8.forwardRef)(
|
|
1515
1515
|
...inputProps,
|
1516
1516
|
className: cn(
|
1517
1517
|
defaultInputStyle,
|
1518
|
-
"
|
1518
|
+
"focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white",
|
1519
1519
|
{
|
1520
1520
|
"hawa-pe-9": props.endIcon,
|
1521
1521
|
"hawa-ps-9": props.startIcon,
|
@@ -1529,7 +1529,7 @@ var Input = (0, import_react8.forwardRef)(
|
|
1529
1529
|
"div",
|
1530
1530
|
{
|
1531
1531
|
className: cn(
|
1532
|
-
"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start
|
1532
|
+
"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all",
|
1533
1533
|
props.helperText ? "hawa-border hawa-p-1" : "hawa-border-none hawa-p-0"
|
1534
1534
|
)
|
1535
1535
|
},
|
@@ -3303,9 +3303,9 @@ var Select = ({
|
|
3303
3303
|
"div",
|
3304
3304
|
{
|
3305
3305
|
className: cn(
|
3306
|
-
"dark:dark-shadow
|
3306
|
+
"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md",
|
3307
3307
|
props.phoneCode ? "hawa-p-1.5" : "hawa-w-full hawa-p-1.5",
|
3308
|
-
menuOpen && "hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95
|
3308
|
+
menuOpen && "hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95"
|
3309
3309
|
),
|
3310
3310
|
ref: innerRef,
|
3311
3311
|
...innerProps
|
@@ -3464,7 +3464,7 @@ var PhoneInput = ({
|
|
3464
3464
|
value: countryCode == null ? void 0 : countryCode.label,
|
3465
3465
|
defaultValue: props.preferredCountry
|
3466
3466
|
}
|
3467
|
-
), /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full
|
3467
|
+
), /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ import_react10.default.createElement(
|
3468
3468
|
"input",
|
3469
3469
|
{
|
3470
3470
|
type: "tel",
|
@@ -3474,7 +3474,7 @@ var PhoneInput = ({
|
|
3474
3474
|
onChange: handleInputChange,
|
3475
3475
|
placeholder: props.placeholder,
|
3476
3476
|
className: cn(
|
3477
|
-
"placeholder:hawa-text-muted-foreground hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent
|
3477
|
+
"placeholder:hawa-text-muted-foreground hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
3478
3478
|
),
|
3479
3479
|
...inputProps
|
3480
3480
|
}
|
@@ -3650,7 +3650,7 @@ var LoginForm = ({
|
|
3650
3650
|
"div",
|
3651
3651
|
{
|
3652
3652
|
onClick: props.onForgotPassword,
|
3653
|
-
className: "hawa-mb-3
|
3653
|
+
className: "hawa-mb-3 hawa-mt-2 hawa-w-fit hawa-cursor-pointer hawa-select-none hawa-text-xs dark:hawa-text-gray-300"
|
3654
3654
|
},
|
3655
3655
|
(texts == null ? void 0 : texts.forgotPassword) || "Forgot Password?"
|
3656
3656
|
)));
|
@@ -4348,7 +4348,7 @@ var RegisterForm = ({
|
|
4348
4348
|
/* @__PURE__ */ import_react17.default.createElement(
|
4349
4349
|
Button,
|
4350
4350
|
{
|
4351
|
-
className: "
|
4351
|
+
className: "hawa-w-full",
|
4352
4352
|
type: "submit",
|
4353
4353
|
isLoading: props.isLoading,
|
4354
4354
|
disabled: props.isLoading
|
@@ -4356,7 +4356,7 @@ var RegisterForm = ({
|
|
4356
4356
|
(texts == null ? void 0 : texts.registerText) || "Register"
|
4357
4357
|
),
|
4358
4358
|
props.additionalButtons
|
4359
|
-
)), props.onRouteToLogin && /* @__PURE__ */ import_react17.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center
|
4359
|
+
)), props.onRouteToLogin && /* @__PURE__ */ import_react17.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ import_react17.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react17.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))),
|
4360
4360
|
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react17.default.createElement(
|
4361
4361
|
CardFooter,
|
4362
4362
|
{
|
@@ -4429,7 +4429,7 @@ var AppLanding = ({ texts, ...props }) => {
|
|
4429
4429
|
// blocks/auth/CheckEmail.tsx
|
4430
4430
|
var import_react19 = __toESM(require("react"));
|
4431
4431
|
var CheckEmail = ({ texts, handleResend }) => {
|
4432
|
-
return /* @__PURE__ */ import_react19.default.createElement(Card, null, /* @__PURE__ */ import_react19.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold
|
4432
|
+
return /* @__PURE__ */ import_react19.default.createElement(Card, null, /* @__PURE__ */ import_react19.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ import_react19.default.createElement(
|
4433
4433
|
"svg",
|
4434
4434
|
{
|
4435
4435
|
stroke: "currentColor",
|
@@ -4444,7 +4444,7 @@ var CheckEmail = ({ texts, handleResend }) => {
|
|
4444
4444
|
},
|
4445
4445
|
/* @__PURE__ */ import_react19.default.createElement("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
|
4446
4446
|
/* @__PURE__ */ import_react19.default.createElement("polyline", { points: "22,6 12,13 2,6" })
|
4447
|
-
)), /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ import_react19.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center
|
4447
|
+
)), /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ import_react19.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center" }, /* @__PURE__ */ import_react19.default.createElement("span", { className: "clickable-link hawa-text-sm", onClick: handleResend }, (texts == null ? void 0 : texts.resendEmail) || "Resend Email")));
|
4448
4448
|
};
|
4449
4449
|
|
4450
4450
|
// blocks/auth/NewPassword.tsx
|
@@ -4856,7 +4856,7 @@ var CodeConfirmation = ({
|
|
4856
4856
|
}
|
4857
4857
|
}
|
4858
4858
|
),
|
4859
|
-
showResendTimer ? /* @__PURE__ */ import_react24.default.createElement("div", { className: "
|
4859
|
+
showResendTimer ? /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react24.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react24.default.createElement(
|
4860
4860
|
"span",
|
4861
4861
|
{
|
4862
4862
|
className: "clickable-link",
|
@@ -1,17 +1,17 @@
|
|
1
1
|
"use client";
|
2
2
|
import {
|
3
3
|
Input
|
4
|
-
} from "../../chunk-
|
4
|
+
} from "../../chunk-EBZECS2Z.mjs";
|
5
5
|
import {
|
6
6
|
StopPropagationWrapper
|
7
7
|
} from "../../chunk-47APBDKK.mjs";
|
8
8
|
import {
|
9
9
|
Select
|
10
|
-
} from "../../chunk-
|
10
|
+
} from "../../chunk-D7HDVJFT.mjs";
|
11
11
|
import {
|
12
12
|
EyeIcon,
|
13
13
|
HiddenEyeIcon
|
14
|
-
} from "../../chunk-
|
14
|
+
} from "../../chunk-CQYG77SY.mjs";
|
15
15
|
import {
|
16
16
|
Button,
|
17
17
|
Card,
|
@@ -24,7 +24,7 @@ import {
|
|
24
24
|
Label,
|
25
25
|
Loading,
|
26
26
|
cn
|
27
|
-
} from "../../chunk-
|
27
|
+
} from "../../chunk-FLMCWOQQ.mjs";
|
28
28
|
|
29
29
|
// blocks/auth/AuthButtons.tsx
|
30
30
|
import React2 from "react";
|
@@ -752,7 +752,7 @@ var Alert = ({
|
|
752
752
|
"data-dismiss-target": "#alert-default",
|
753
753
|
"aria-label": "Close",
|
754
754
|
className: cn(
|
755
|
-
"hawa-absolute
|
755
|
+
"hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-9 hawa-w-9 hawa-items-center hawa-justify-center hawa-rounded-inner hawa-p-1.5 hawa-transition-all hover:hawa-text-gray-900",
|
756
756
|
closeButtonStyle[severity],
|
757
757
|
direction === "rtl" ? "hawa-left-2" : "hawa-right-2"
|
758
758
|
),
|
@@ -2530,7 +2530,7 @@ var PhoneInput = ({
|
|
2530
2530
|
value: countryCode == null ? void 0 : countryCode.label,
|
2531
2531
|
defaultValue: props.preferredCountry
|
2532
2532
|
}
|
2533
|
-
), /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full
|
2533
|
+
), /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React4.createElement(
|
2534
2534
|
"input",
|
2535
2535
|
{
|
2536
2536
|
type: "tel",
|
@@ -2540,7 +2540,7 @@ var PhoneInput = ({
|
|
2540
2540
|
onChange: handleInputChange,
|
2541
2541
|
placeholder: props.placeholder,
|
2542
2542
|
className: cn(
|
2543
|
-
"placeholder:hawa-text-muted-foreground hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent
|
2543
|
+
"placeholder:hawa-text-muted-foreground hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
2544
2544
|
),
|
2545
2545
|
...inputProps
|
2546
2546
|
}
|
@@ -2677,7 +2677,7 @@ var LoginForm = ({
|
|
2677
2677
|
"div",
|
2678
2678
|
{
|
2679
2679
|
onClick: props.onForgotPassword,
|
2680
|
-
className: "hawa-mb-3
|
2680
|
+
className: "hawa-mb-3 hawa-mt-2 hawa-w-fit hawa-cursor-pointer hawa-select-none hawa-text-xs dark:hawa-text-gray-300"
|
2681
2681
|
},
|
2682
2682
|
(texts == null ? void 0 : texts.forgotPassword) || "Forgot Password?"
|
2683
2683
|
)));
|
@@ -3366,7 +3366,7 @@ var RegisterForm = ({
|
|
3366
3366
|
/* @__PURE__ */ React7.createElement(
|
3367
3367
|
Button,
|
3368
3368
|
{
|
3369
|
-
className: "
|
3369
|
+
className: "hawa-w-full",
|
3370
3370
|
type: "submit",
|
3371
3371
|
isLoading: props.isLoading,
|
3372
3372
|
disabled: props.isLoading
|
@@ -3374,7 +3374,7 @@ var RegisterForm = ({
|
|
3374
3374
|
(texts == null ? void 0 : texts.registerText) || "Register"
|
3375
3375
|
),
|
3376
3376
|
props.additionalButtons
|
3377
|
-
)), props.onRouteToLogin && /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center
|
3377
|
+
)), props.onRouteToLogin && /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ React7.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React7.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))),
|
3378
3378
|
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React7.createElement(
|
3379
3379
|
CardFooter,
|
3380
3380
|
{
|
@@ -3447,7 +3447,7 @@ var AppLanding = ({ texts, ...props }) => {
|
|
3447
3447
|
// blocks/auth/CheckEmail.tsx
|
3448
3448
|
import React9 from "react";
|
3449
3449
|
var CheckEmail = ({ texts, handleResend }) => {
|
3450
|
-
return /* @__PURE__ */ React9.createElement(Card, null, /* @__PURE__ */ React9.createElement(CardContent, { headless: true }, /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold
|
3450
|
+
return /* @__PURE__ */ React9.createElement(Card, null, /* @__PURE__ */ React9.createElement(CardContent, { headless: true }, /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ React9.createElement(
|
3451
3451
|
"svg",
|
3452
3452
|
{
|
3453
3453
|
stroke: "currentColor",
|
@@ -3462,7 +3462,7 @@ var CheckEmail = ({ texts, handleResend }) => {
|
|
3462
3462
|
},
|
3463
3463
|
/* @__PURE__ */ React9.createElement("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
|
3464
3464
|
/* @__PURE__ */ React9.createElement("polyline", { points: "22,6 12,13 2,6" })
|
3465
|
-
)), /* @__PURE__ */ React9.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ React9.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ React9.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center
|
3465
|
+
)), /* @__PURE__ */ React9.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ React9.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ React9.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center" }, /* @__PURE__ */ React9.createElement("span", { className: "clickable-link hawa-text-sm", onClick: handleResend }, (texts == null ? void 0 : texts.resendEmail) || "Resend Email")));
|
3466
3466
|
};
|
3467
3467
|
|
3468
3468
|
// blocks/auth/NewPassword.tsx
|
@@ -3874,7 +3874,7 @@ var CodeConfirmation = ({
|
|
3874
3874
|
}
|
3875
3875
|
}
|
3876
3876
|
),
|
3877
|
-
showResendTimer ? /* @__PURE__ */ React13.createElement("div", { className: "
|
3877
|
+
showResendTimer ? /* @__PURE__ */ React13.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ React13.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ React13.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ React13.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ React13.createElement(
|
3878
3878
|
"span",
|
3879
3879
|
{
|
3880
3880
|
className: "clickable-link",
|