@sikka/hawa 0.46.4-next → 0.48.0-next

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/{Radio-Dyvlywnk.d.mts → Radio-BPHTeDMz.d.mts} +8 -7
  2. package/dist/{Radio-DlPwVCG4.d.ts → Radio-cRcIH8_L.d.ts} +8 -7
  3. package/dist/blocks/auth/index.d.mts +34 -17
  4. package/dist/blocks/auth/index.d.ts +34 -17
  5. package/dist/blocks/auth/index.js +1008 -430
  6. package/dist/blocks/auth/index.mjs +427 -297
  7. package/dist/blocks/feedback/index.d.mts +1 -1
  8. package/dist/blocks/feedback/index.d.ts +1 -1
  9. package/dist/blocks/feedback/index.js +68 -79
  10. package/dist/blocks/feedback/index.mjs +1 -1
  11. package/dist/blocks/index.d.mts +28 -11
  12. package/dist/blocks/index.d.ts +28 -11
  13. package/dist/blocks/index.js +2340 -2233
  14. package/dist/blocks/index.mjs +407 -269
  15. package/dist/blocks/misc/index.d.mts +1 -1
  16. package/dist/blocks/misc/index.d.ts +1 -1
  17. package/dist/blocks/misc/index.js +68 -79
  18. package/dist/blocks/misc/index.mjs +50 -367
  19. package/dist/blocks/pricing/index.d.mts +1 -1
  20. package/dist/blocks/pricing/index.d.ts +1 -1
  21. package/dist/blocks/pricing/index.mjs +1 -1
  22. package/dist/{chunk-6TG2PHZK.mjs → chunk-AWJSHOYU.mjs} +68 -79
  23. package/dist/{chunk-5CTMGPEF.mjs → chunk-GBLWUEYN.mjs} +650 -674
  24. package/dist/chunk-JFWD2ICY.mjs +511 -0
  25. package/dist/elements/index.d.mts +2 -2
  26. package/dist/elements/index.d.ts +2 -2
  27. package/dist/elements/index.js +81 -105
  28. package/dist/elements/index.mjs +1 -1
  29. package/dist/index.css +7 -0
  30. package/dist/index.d.mts +36 -17
  31. package/dist/index.d.ts +36 -17
  32. package/dist/index.js +482 -373
  33. package/dist/index.mjs +487 -373
  34. package/dist/phoneInput/index.d.mts +7 -7
  35. package/dist/phoneInput/index.d.ts +7 -7
  36. package/dist/phoneInput/index.js +78 -85
  37. package/dist/phoneInput/index.js.map +1 -1
  38. package/dist/phoneInput/index.mjs +78 -85
  39. package/dist/phoneInput/index.mjs.map +1 -1
  40. package/dist/pinInput/index.js +3 -20
  41. package/dist/pinInput/index.js.map +1 -1
  42. package/dist/pinInput/index.mjs +3 -20
  43. package/dist/pinInput/index.mjs.map +1 -1
  44. package/dist/select/index.d.mts +1 -0
  45. package/dist/select/index.d.ts +1 -0
  46. package/dist/select/index.js +68 -79
  47. package/dist/select/index.js.map +1 -1
  48. package/dist/select/index.mjs +68 -79
  49. package/dist/select/index.mjs.map +1 -1
  50. package/dist/{textTypes-DXLtO2fL.d.mts → textTypes-CYQYIsFt.d.mts} +1 -0
  51. package/dist/{textTypes-DXLtO2fL.d.ts → textTypes-CYQYIsFt.d.ts} +1 -0
  52. package/dist/types/index.d.mts +1 -0
  53. package/dist/types/index.d.ts +1 -0
  54. package/package.json +1 -1
  55. package/dist/chunk-EOH6A3GR.mjs +0 -183
@@ -157,14 +157,7 @@ var PinInputRoot = React2.forwardRef(({ className, containerClassName, ...props
157
157
  }
158
158
  ));
159
159
  PinInputRoot.displayName = "PinInputRoot";
160
- var PinInputGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
161
- "div",
162
- {
163
- ref,
164
- className: cn("hawa-flex hawa-items-center", className),
165
- ...props
166
- }
167
- ));
160
+ var PinInputGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
168
161
  PinInputGroup.displayName = "PinInputGroup";
169
162
  var PinInputSlot = React2.forwardRef(({ index, className, ...props }, ref) => {
170
163
  const pinInputContext = React2.useContext(import_input_otp.OTPInputContext);
@@ -187,22 +180,12 @@ var PinInputSlot = React2.forwardRef(({ index, className, ...props }, ref) => {
187
180
  PinInputSlot.displayName = "PinInputSlot";
188
181
  var PinInputSeperator = React2.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React2.createElement(Dot, null)));
189
182
  PinInputSeperator.displayName = "PinInputSeperator";
190
- var PinInput = ({
191
- separatorPosition = 0,
192
- ...props
193
- }) => {
183
+ var PinInput = ({ separatorPosition = 0, ...props }) => {
194
184
  const maxLength = props.maxLength || 6;
195
185
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
196
186
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
197
187
  const secondGroupLength = maxLength - firstGroupLength;
198
- return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React2.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(
199
- PinInputSlot,
200
- {
201
- key: index,
202
- index,
203
- className: "hawa-w-full hawa-border"
204
- }
205
- ))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React2.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(
188
+ return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React2.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React2.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(
206
189
  PinInputSlot,
207
190
  {
208
191
  key: index + firstGroupLength,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/pinInput/index.ts","../../elements/pinInput/PinInput.tsx","../../util/index.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/shared/src/utils.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/defaultAttributes.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/Icon.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/createLucideIcon.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/icons/dot.ts","../../elements/helperText/HelperText.tsx"],"sourcesContent":["export * from \"./PinInput\";\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { OTPInput, OTPInputContext, OTPInputProps } from \"input-otp\";\nimport { Dot } from \"lucide-react\";\n\nimport { HelperText } from \"../helperText\";\n\nconst PinInputRoot = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:hawa-cursor-not-allowed\", className)}\n {...props}\n />\n));\nPinInputRoot.displayName = \"PinInputRoot\";\n\nconst PinInputGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"hawa-flex hawa-items-center\", className)}\n {...props}\n />\n));\nPinInputGroup.displayName = \"PinInputGroup\";\n\nconst PinInputSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const pinInputContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"hawa-border-input hawa-relative hawa-flex hawa-h-10 hawa-w-10 hawa-items-center hawa-justify-center hawa-border-y hawa-border-r hawa-text-sm hawa-transition-all first:hawa-rounded-l-md first:hawa-border-l last:hawa-rounded-r-md\",\n isActive &&\n \"hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center\">\n <div className=\"hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000\" />\n </div>\n )}\n </div>\n );\n});\nPinInputSlot.displayName = \"PinInputSlot\";\n\nconst PinInputSeperator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n));\nPinInputSeperator.displayName = \"PinInputSeperator\";\n\ntype PinInputProps = Omit<OTPInputProps, \"render\"> & {\n /*\n * The position of the separator in the pin input\n * @default 3\n */\n separatorPosition?: number;\n helperText?: any;\n};\n\nconst PinInput: React.FC<PinInputProps> = ({\n separatorPosition = 0,\n ...props\n}) => {\n const maxLength = props.maxLength || 6; // Assuming a default maxLength of 6 if not provided\n const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);\n\n const firstGroupLength =\n clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;\n const secondGroupLength = maxLength - firstGroupLength;\n\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n <PinInputRoot {...props}>\n {firstGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full hawa-gap-2\">\n {[...Array(firstGroupLength)].map((_, index) => (\n <PinInputSlot\n key={index}\n index={index}\n className=\"hawa-w-full hawa-border\"\n />\n ))}\n </PinInputGroup>\n )}\n {separatorPosition > 0 && separatorPosition < props.maxLength && (\n <PinInputSeperator />\n )}\n {secondGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full hawa-gap-2\">\n {[...Array(secondGroupLength)].map((_, index) => (\n <PinInputSlot\n key={index + firstGroupLength}\n index={index + firstGroupLength}\n className=\"hawa-w-full hawa-border\"\n />\n ))}\n </PinInputGroup>\n )}\n </PinInputRoot>\n <HelperText helperText={props.helperText} />\n </div>\n );\n};\n\nexport {\n PinInput,\n PinInputRoot,\n PinInputGroup,\n PinInputSlot,\n PinInputSeperator,\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 { CamelToPascal } from './utility-types';\n\n/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = string.replace(/^([A-Z])|[\\s-_]+(\\w)/g, (match, p1, p2) =>\n p2 ? p2.toUpperCase() : p1.toLowerCase(),\n );\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n\n/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return Boolean(className) && array.indexOf(className) === index;\n })\n .join(' ');\n","export default {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n};\n","import { createElement, forwardRef } from 'react';\nimport defaultAttributes from './defaultAttributes';\nimport { IconNode, LucideProps } from './types';\nimport { mergeClasses } from '@lucide/shared';\n\ninterface IconComponentProps extends LucideProps {\n iconNode: IconNode;\n}\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {string} props.className - The class name of the icon\n * @param {IconNode} props.children - The children of the icon\n * @param {IconNode} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color = 'currentColor',\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = '',\n children,\n iconNode,\n ...rest\n },\n ref,\n ) => {\n return createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth,\n className: mergeClasses('lucide', className),\n ...rest,\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n","import { createElement, forwardRef } from 'react';\nimport { mergeClasses, toKebabCase } from '@lucide/shared';\nimport { IconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Create a Lucide icon component\n * @param {string} iconName\n * @param {array} iconNode\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst createLucideIcon = (iconName: string, iconNode: IconNode) => {\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),\n ...props,\n }),\n );\n\n Component.displayName = `${iconName}`;\n\n return Component;\n};\n\nexport default createLucideIcon;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Dot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi4xIiBjeT0iMTIuMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Dot = createLucideIcon('Dot', [\n ['circle', { cx: '12.1', cy: '12.1', r: '1', key: '18d7e5' }],\n]);\n\nexport default Dot;\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,Q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aAAa,GAAG,SAClC,qCAAC,SAAI,CACP,CACD;AACD,kBAAkB,cAAc;AAWhC,IAAM,WAAoC,CAAC;AAAA,EACzC,oBAAoB;AAAA,EACpB,GAAG;AACL,MAAM;AACJ,QAAM,YAAY,MAAM,aAAa;AACrC,QAAM,2BAA2B,KAAK,IAAI,mBAAmB,SAAS;AAEtE,QAAM,mBACJ,2BAA2B,IAAI,2BAA2B;AAC5D,QAAM,oBAAoB,YAAY;AAEtC,SACE,qCAAC,SAAI,WAAU,wCACb,qCAAC,gBAAc,GAAG,SACf,mBAAmB,KAClB,qCAAC,iBAAc,WAAU,4BACtB,CAAC,GAAG,MAAM,gBAAgB,CAAC,EAAE,IAAI,CAAC,GAAG,UACpC;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA,WAAU;AAAA;AAAA,EACZ,CACD,CACH,GAED,oBAAoB,KAAK,oBAAoB,MAAM,aAClD,qCAAC,uBAAkB,GAEpB,oBAAoB,KACnB,qCAAC,iBAAc,WAAU,4BACtB,CAAC,GAAG,MAAM,iBAAiB,CAAC,EAAE,IAAI,CAAC,GAAG,UACrC;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,QAAQ;AAAA,MACb,OAAO,QAAQ;AAAA,MACf,WAAU;AAAA;AAAA,EACZ,CACD,CACH,CAEJ,GACA,qCAAC,cAAW,YAAY,MAAM,YAAY,CAC5C;AAEJ;","names":["React","import_react","React"]}
1
+ {"version":3,"sources":["../../elements/pinInput/index.ts","../../elements/pinInput/PinInput.tsx","../../util/index.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/shared/src/utils.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/defaultAttributes.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/Icon.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/createLucideIcon.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/icons/dot.ts","../../elements/helperText/HelperText.tsx"],"sourcesContent":["export * from \"./PinInput\";\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { OTPInput, OTPInputContext, OTPInputProps } from \"input-otp\";\nimport { Dot } from \"lucide-react\";\n\nimport { HelperText } from \"../helperText\";\n\nconst PinInputRoot = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:hawa-cursor-not-allowed\", className)}\n {...props}\n />\n));\nPinInputRoot.displayName = \"PinInputRoot\";\n\nconst PinInputGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"hawa-flex hawa-items-center\", className)} {...props} />\n));\nPinInputGroup.displayName = \"PinInputGroup\";\n\nconst PinInputSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const pinInputContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"hawa-border-input hawa-relative hawa-flex hawa-h-10 hawa-w-10 hawa-items-center hawa-justify-center hawa-border-y hawa-border-r hawa-text-sm hawa-transition-all first:hawa-rounded-l-md first:hawa-border-l last:hawa-rounded-r-md\",\n isActive && \"hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center\">\n <div className=\"hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000\" />\n </div>\n )}\n </div>\n );\n});\nPinInputSlot.displayName = \"PinInputSlot\";\n\nconst PinInputSeperator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n));\nPinInputSeperator.displayName = \"PinInputSeperator\";\n\ntype PinInputProps = Omit<OTPInputProps, \"render\"> & {\n /*\n * The position of the separator in the pin input\n * @default 3\n */\n separatorPosition?: number;\n helperText?: any;\n};\n\nconst PinInput: React.FC<PinInputProps> = ({ separatorPosition = 0, ...props }) => {\n const maxLength = props.maxLength || 6; // Assuming a default maxLength of 6 if not provided\n const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);\n\n const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;\n const secondGroupLength = maxLength - firstGroupLength;\n\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\" dir=\"ltr\">\n <PinInputRoot {...props}>\n {firstGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full hawa-gap-2\">\n {[...Array(firstGroupLength)].map((_, index) => (\n <PinInputSlot key={index} index={index} className=\"hawa-w-full hawa-border\" />\n ))}\n </PinInputGroup>\n )}\n {separatorPosition > 0 && separatorPosition < props.maxLength && <PinInputSeperator />}\n {secondGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full hawa-gap-2\">\n {[...Array(secondGroupLength)].map((_, index) => (\n <PinInputSlot\n key={index + firstGroupLength}\n index={index + firstGroupLength}\n className=\"hawa-w-full hawa-border\"\n />\n ))}\n </PinInputGroup>\n )}\n </PinInputRoot>\n <HelperText helperText={props.helperText} />\n </div>\n );\n};\n\nexport { PinInput, PinInputRoot, PinInputGroup, PinInputSlot, PinInputSeperator };\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 { CamelToPascal } from './utility-types';\n\n/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = string.replace(/^([A-Z])|[\\s-_]+(\\w)/g, (match, p1, p2) =>\n p2 ? p2.toUpperCase() : p1.toLowerCase(),\n );\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n\n/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return Boolean(className) && array.indexOf(className) === index;\n })\n .join(' ');\n","export default {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n};\n","import { createElement, forwardRef } from 'react';\nimport defaultAttributes from './defaultAttributes';\nimport { IconNode, LucideProps } from './types';\nimport { mergeClasses } from '@lucide/shared';\n\ninterface IconComponentProps extends LucideProps {\n iconNode: IconNode;\n}\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {string} props.className - The class name of the icon\n * @param {IconNode} props.children - The children of the icon\n * @param {IconNode} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color = 'currentColor',\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = '',\n children,\n iconNode,\n ...rest\n },\n ref,\n ) => {\n return createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth,\n className: mergeClasses('lucide', className),\n ...rest,\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n","import { createElement, forwardRef } from 'react';\nimport { mergeClasses, toKebabCase } from '@lucide/shared';\nimport { IconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Create a Lucide icon component\n * @param {string} iconName\n * @param {array} iconNode\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst createLucideIcon = (iconName: string, iconNode: IconNode) => {\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),\n ...props,\n }),\n );\n\n Component.displayName = `${iconName}`;\n\n return Component;\n};\n\nexport default createLucideIcon;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Dot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi4xIiBjeT0iMTIuMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Dot = createLucideIcon('Dot', [\n ['circle', { cx: '12.1', cy: '12.1', r: '1', key: '18d7e5' }],\n]);\n\nexport default Dot;\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADFA,uBAAyD;;;;;;AEK5C,IAAA,cAAc,CAAC,WAC1B,OAAO,QAAQ,sBAAsB,OAAO,EAAE,YAAY;AAsB/C,IAAA,eAAe,IAA2C,YACrE,QACG,OAAO,CAAC,WAAW,OAAO,UAAU;AACnC,SAAO,QAAQ,SAAS,KAAK,MAAM,QAAQ,SAAS,MAAM;AAC5D,CAAC,EACA,KAAK,GAAG;;;;;;ACpCb,IAAe,oBAAA;EACb,OAAO;EACP,OAAO;EACP,QAAQ;EACR,SAAS;EACT,MAAM;EACN,QAAQ;EACR,aAAa;EACb,eAAe;EACf,gBAAgB;AAClB;;;ACcA,IAAM,WAAO;EACX,CACE;IACE,QAAQ;IACR,OAAO;IACP,cAAc;IACd;IACA,YAAY;IACZ;IACA;IACA,GAAG;EAAA,GAEL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AoB,KACnB,qCAAC,iBAAc,WAAU,4BACtB,CAAC,GAAG,MAAM,iBAAiB,CAAC,EAAE,IAAI,CAAC,GAAG,UACrC;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,QAAQ;AAAA,MACb,OAAO,QAAQ;AAAA,MACf,WAAU;AAAA;AAAA,EACZ,CACD,CACH,CAEJ,GACA,qCAAC,cAAW,YAAY,MAAM,YAAY,CAC5C;AAEJ;","names":["React","import_react","React"]}
@@ -118,14 +118,7 @@ var PinInputRoot = React2.forwardRef(({ className, containerClassName, ...props
118
118
  }
119
119
  ));
120
120
  PinInputRoot.displayName = "PinInputRoot";
121
- var PinInputGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
122
- "div",
123
- {
124
- ref,
125
- className: cn("hawa-flex hawa-items-center", className),
126
- ...props
127
- }
128
- ));
121
+ var PinInputGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
129
122
  PinInputGroup.displayName = "PinInputGroup";
130
123
  var PinInputSlot = React2.forwardRef(({ index, className, ...props }, ref) => {
131
124
  const pinInputContext = React2.useContext(OTPInputContext);
@@ -148,22 +141,12 @@ var PinInputSlot = React2.forwardRef(({ index, className, ...props }, ref) => {
148
141
  PinInputSlot.displayName = "PinInputSlot";
149
142
  var PinInputSeperator = React2.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React2.createElement(Dot, null)));
150
143
  PinInputSeperator.displayName = "PinInputSeperator";
151
- var PinInput = ({
152
- separatorPosition = 0,
153
- ...props
154
- }) => {
144
+ var PinInput = ({ separatorPosition = 0, ...props }) => {
155
145
  const maxLength = props.maxLength || 6;
156
146
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
157
147
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
158
148
  const secondGroupLength = maxLength - firstGroupLength;
159
- return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React2.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(
160
- PinInputSlot,
161
- {
162
- key: index,
163
- index,
164
- className: "hawa-w-full hawa-border"
165
- }
166
- ))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React2.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(
149
+ return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React2.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React2.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(
167
150
  PinInputSlot,
168
151
  {
169
152
  key: index + firstGroupLength,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/pinInput/PinInput.tsx","../../util/index.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/shared/src/utils.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/defaultAttributes.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/Icon.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/createLucideIcon.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/icons/dot.ts","../../elements/helperText/HelperText.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { OTPInput, OTPInputContext, OTPInputProps } from \"input-otp\";\nimport { Dot } from \"lucide-react\";\n\nimport { HelperText } from \"../helperText\";\n\nconst PinInputRoot = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:hawa-cursor-not-allowed\", className)}\n {...props}\n />\n));\nPinInputRoot.displayName = \"PinInputRoot\";\n\nconst PinInputGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"hawa-flex hawa-items-center\", className)}\n {...props}\n />\n));\nPinInputGroup.displayName = \"PinInputGroup\";\n\nconst PinInputSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const pinInputContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"hawa-border-input hawa-relative hawa-flex hawa-h-10 hawa-w-10 hawa-items-center hawa-justify-center hawa-border-y hawa-border-r hawa-text-sm hawa-transition-all first:hawa-rounded-l-md first:hawa-border-l last:hawa-rounded-r-md\",\n isActive &&\n \"hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center\">\n <div className=\"hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000\" />\n </div>\n )}\n </div>\n );\n});\nPinInputSlot.displayName = \"PinInputSlot\";\n\nconst PinInputSeperator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n));\nPinInputSeperator.displayName = \"PinInputSeperator\";\n\ntype PinInputProps = Omit<OTPInputProps, \"render\"> & {\n /*\n * The position of the separator in the pin input\n * @default 3\n */\n separatorPosition?: number;\n helperText?: any;\n};\n\nconst PinInput: React.FC<PinInputProps> = ({\n separatorPosition = 0,\n ...props\n}) => {\n const maxLength = props.maxLength || 6; // Assuming a default maxLength of 6 if not provided\n const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);\n\n const firstGroupLength =\n clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;\n const secondGroupLength = maxLength - firstGroupLength;\n\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n <PinInputRoot {...props}>\n {firstGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full hawa-gap-2\">\n {[...Array(firstGroupLength)].map((_, index) => (\n <PinInputSlot\n key={index}\n index={index}\n className=\"hawa-w-full hawa-border\"\n />\n ))}\n </PinInputGroup>\n )}\n {separatorPosition > 0 && separatorPosition < props.maxLength && (\n <PinInputSeperator />\n )}\n {secondGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full hawa-gap-2\">\n {[...Array(secondGroupLength)].map((_, index) => (\n <PinInputSlot\n key={index + firstGroupLength}\n index={index + firstGroupLength}\n className=\"hawa-w-full hawa-border\"\n />\n ))}\n </PinInputGroup>\n )}\n </PinInputRoot>\n <HelperText helperText={props.helperText} />\n </div>\n );\n};\n\nexport {\n PinInput,\n PinInputRoot,\n PinInputGroup,\n PinInputSlot,\n PinInputSeperator,\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 { CamelToPascal } from './utility-types';\n\n/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = string.replace(/^([A-Z])|[\\s-_]+(\\w)/g, (match, p1, p2) =>\n p2 ? p2.toUpperCase() : p1.toLowerCase(),\n );\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n\n/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return Boolean(className) && array.indexOf(className) === index;\n })\n .join(' ');\n","export default {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n};\n","import { createElement, forwardRef } from 'react';\nimport defaultAttributes from './defaultAttributes';\nimport { IconNode, LucideProps } from './types';\nimport { mergeClasses } from '@lucide/shared';\n\ninterface IconComponentProps extends LucideProps {\n iconNode: IconNode;\n}\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {string} props.className - The class name of the icon\n * @param {IconNode} props.children - The children of the icon\n * @param {IconNode} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color = 'currentColor',\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = '',\n children,\n iconNode,\n ...rest\n },\n ref,\n ) => {\n return createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth,\n className: mergeClasses('lucide', className),\n ...rest,\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n","import { createElement, forwardRef } from 'react';\nimport { mergeClasses, toKebabCase } from '@lucide/shared';\nimport { IconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Create a Lucide icon component\n * @param {string} iconName\n * @param {array} iconNode\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst createLucideIcon = (iconName: string, iconNode: IconNode) => {\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),\n ...props,\n }),\n );\n\n Component.displayName = `${iconName}`;\n\n return Component;\n};\n\nexport default createLucideIcon;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Dot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi4xIiBjeT0iMTIuMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Dot = createLucideIcon('Dot', [\n ['circle', { cx: '12.1', cy: '12.1', r: '1', key: '18d7e5' }],\n]);\n\nexport default Dot;\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n"],"mappings":";;;AAAA,YAAYA,YAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADFA,SAAS,UAAU,uBAAsC;;;;;;AEK5C,IAAA,cAAc,CAAC,WAC1B,OAAO,QAAQ,sBAAsB,OAAO,EAAE,YAAY;AAsB/C,IAAA,eAAe,IAA2C,YACrE,QACG,OAAO,CAAC,WAAW,OAAO,UAAU;AACnC,SAAO,QAAQ,SAAS,KAAK,MAAM,QAAQ,SAAS,MAAM;AAC5D,CAAC,EACA,KAAK,GAAG;;;;;;ACpCb,IAAe,oBAAA;EACb,OAAO;EACP,OAAO;EACP,QAAQ;EACR,SAAS;EACT,MAAM;EACN,QAAQ;EACR,aAAa;EACb,eAAe;EACf,gBAAgB;AAClB;;;ACcA,IAAM,OAAO;EACX,CACE;IACE,QAAQ;IACR,OAAO;IACP,cAA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AAA,EACZ,CACD,CACH,GAED,oBAAoB,KAAK,oBAAoB,MAAM,aAClD,qCAAC,uBAAkB,GAEpB,oBAAoB,KACnB,qCAAC,iBAAc,WAAU,4BACtB,CAAC,GAAG,MAAM,iBAAiB,CAAC,EAAE,IAAI,CAAC,GAAG,UACrC;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,QAAQ;AAAA,MACb,OAAO,QAAQ;AAAA,MACf,WAAU;AAAA;AAAA,EACZ,CACD,CACH,CAEJ,GACA,qCAAC,cAAW,YAAY,MAAM,YAAY,CAC5C;AAEJ;","names":["React","forwardRef","createElement"]}
1
+ {"version":3,"sources":["../../elements/pinInput/PinInput.tsx","../../util/index.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/shared/src/utils.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/defaultAttributes.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/Icon.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/createLucideIcon.ts","../../../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/src/icons/dot.ts","../../elements/helperText/HelperText.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { OTPInput, OTPInputContext, OTPInputProps } from \"input-otp\";\nimport { Dot } from \"lucide-react\";\n\nimport { HelperText } from \"../helperText\";\n\nconst PinInputRoot = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:hawa-cursor-not-allowed\", className)}\n {...props}\n />\n));\nPinInputRoot.displayName = \"PinInputRoot\";\n\nconst PinInputGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"hawa-flex hawa-items-center\", className)} {...props} />\n));\nPinInputGroup.displayName = \"PinInputGroup\";\n\nconst PinInputSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const pinInputContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"hawa-border-input hawa-relative hawa-flex hawa-h-10 hawa-w-10 hawa-items-center hawa-justify-center hawa-border-y hawa-border-r hawa-text-sm hawa-transition-all first:hawa-rounded-l-md first:hawa-border-l last:hawa-rounded-r-md\",\n isActive && \"hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center\">\n <div className=\"hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000\" />\n </div>\n )}\n </div>\n );\n});\nPinInputSlot.displayName = \"PinInputSlot\";\n\nconst PinInputSeperator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n));\nPinInputSeperator.displayName = \"PinInputSeperator\";\n\ntype PinInputProps = Omit<OTPInputProps, \"render\"> & {\n /*\n * The position of the separator in the pin input\n * @default 3\n */\n separatorPosition?: number;\n helperText?: any;\n};\n\nconst PinInput: React.FC<PinInputProps> = ({ separatorPosition = 0, ...props }) => {\n const maxLength = props.maxLength || 6; // Assuming a default maxLength of 6 if not provided\n const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);\n\n const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;\n const secondGroupLength = maxLength - firstGroupLength;\n\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\" dir=\"ltr\">\n <PinInputRoot {...props}>\n {firstGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full hawa-gap-2\">\n {[...Array(firstGroupLength)].map((_, index) => (\n <PinInputSlot key={index} index={index} className=\"hawa-w-full hawa-border\" />\n ))}\n </PinInputGroup>\n )}\n {separatorPosition > 0 && separatorPosition < props.maxLength && <PinInputSeperator />}\n {secondGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full hawa-gap-2\">\n {[...Array(secondGroupLength)].map((_, index) => (\n <PinInputSlot\n key={index + firstGroupLength}\n index={index + firstGroupLength}\n className=\"hawa-w-full hawa-border\"\n />\n ))}\n </PinInputGroup>\n )}\n </PinInputRoot>\n <HelperText helperText={props.helperText} />\n </div>\n );\n};\n\nexport { PinInput, PinInputRoot, PinInputGroup, PinInputSlot, PinInputSeperator };\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 { CamelToPascal } from './utility-types';\n\n/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = string.replace(/^([A-Z])|[\\s-_]+(\\w)/g, (match, p1, p2) =>\n p2 ? p2.toUpperCase() : p1.toLowerCase(),\n );\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n\n/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return Boolean(className) && array.indexOf(className) === index;\n })\n .join(' ');\n","export default {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n};\n","import { createElement, forwardRef } from 'react';\nimport defaultAttributes from './defaultAttributes';\nimport { IconNode, LucideProps } from './types';\nimport { mergeClasses } from '@lucide/shared';\n\ninterface IconComponentProps extends LucideProps {\n iconNode: IconNode;\n}\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {string} props.className - The class name of the icon\n * @param {IconNode} props.children - The children of the icon\n * @param {IconNode} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color = 'currentColor',\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = '',\n children,\n iconNode,\n ...rest\n },\n ref,\n ) => {\n return createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth,\n className: mergeClasses('lucide', className),\n ...rest,\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n","import { createElement, forwardRef } from 'react';\nimport { mergeClasses, toKebabCase } from '@lucide/shared';\nimport { IconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Create a Lucide icon component\n * @param {string} iconName\n * @param {array} iconNode\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst createLucideIcon = (iconName: string, iconNode: IconNode) => {\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),\n ...props,\n }),\n );\n\n Component.displayName = `${iconName}`;\n\n return Component;\n};\n\nexport default createLucideIcon;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Dot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi4xIiBjeT0iMTIuMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Dot = createLucideIcon('Dot', [\n ['circle', { cx: '12.1', cy: '12.1', r: '1', key: '18d7e5' }],\n]);\n\nexport default Dot;\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n"],"mappings":";;;AAAA,YAAYA,YAAW;;;ACAvB,SAAS,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,MAAK,aAAa,GAAG,SAClC,qCAAC,SAAI,CACP,CACD;AACD,kBAAkB,cAAc;AAWhC,IAAM,WAAoC,CAAC,EAAE,oBAAoB,GAAG,GAAG,MAAM,MAAM;AACjF,QAAM,YAAY,MAAM,aAAa;AACrC,QAAM,2BAA2B,KAAK,IAAI,mBAAmB,SAAS;AAEtE,QAAM,mBAAmB,2BAA2B,IAAI,2BAA2B;AACnF,QAAM,oBAAoB,YAAY;AAEtC,SACE,qCAAC,SAAI,WAAU,sCAAqC,KAAI,SACtD,qCAAC,gBAAc,GAAG,SACf,mBAAmB,KAClB,qCAAC,iBAAc,WAAU,4BACtB,CAAC,GAAG,MAAM,gBAAgB,CAAC,EAAE,IAAI,CAAC,GAAG,UACpC,qCAAC,gBAAa,KAAK,OAAO,OAAc,WAAU,2BAA0B,CAC7E,CACH,GAED,oBAAoB,KAAK,oBAAoB,MAAM,aAAa,qCAAC,uBAAkB,GACnF,oBAAoB,KACnB,qCAAC,iBAAc,WAAU,4BACtB,CAAC,GAAG,MAAM,iBAAiB,CAAC,EAAE,IAAI,CAAC,GAAG,UACrC;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,QAAQ;AAAA,MACb,OAAO,QAAQ;AAAA,MACf,WAAU;AAAA;AAAA,EACZ,CACD,CACH,CAEJ,GACA,qCAAC,cAAW,YAAY,MAAM,YAAY,CAC5C;AAEJ;","names":["React","forwardRef","createElement"]}
@@ -18,6 +18,7 @@ type SelectTypes = {
18
18
  hideHelperText?: boolean;
19
19
  options: SelectOptionProps[];
20
20
  labelKey?: string;
21
+ valueKey?: string;
21
22
  isCreatable?: boolean;
22
23
  isClearable?: boolean;
23
24
  isMulti?: boolean;
@@ -18,6 +18,7 @@ type SelectTypes = {
18
18
  hideHelperText?: boolean;
19
19
  options: SelectOptionProps[];
20
20
  labelKey?: string;
21
+ valueKey?: string;
21
22
  isCreatable?: boolean;
22
23
  isClearable?: boolean;
23
24
  isMulti?: boolean;
@@ -226,6 +226,7 @@ function Skeleton({
226
226
  var Select = ({
227
227
  labelProps,
228
228
  labelKey = "label",
229
+ valueKey = "value",
229
230
  ...props
230
231
  }) => {
231
232
  const NoOption = () => {
@@ -245,13 +246,7 @@ var Select = ({
245
246
  children
246
247
  );
247
248
  };
248
- const Option = ({
249
- children,
250
- innerProps,
251
- innerRef,
252
- isFocused,
253
- isSelected
254
- }) => {
249
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
255
250
  return /* @__PURE__ */ import_react4.default.createElement(
256
251
  "div",
257
252
  {
@@ -266,14 +261,7 @@ var Select = ({
266
261
  children
267
262
  );
268
263
  };
269
- const Menu = ({
270
- cx,
271
- children,
272
- getStyles,
273
- innerProps,
274
- innerRef,
275
- ...menuProps
276
- }) => {
264
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
277
265
  const menuOpen = menuProps.selectProps.menuIsOpen;
278
266
  return /* @__PURE__ */ import_react4.default.createElement(
279
267
  "div",
@@ -302,71 +290,72 @@ var Select = ({
302
290
  )
303
291
  },
304
292
  props.label && /* @__PURE__ */ import_react4.default.createElement(Label, { ...labelProps }, props.label),
305
- props.isLoading ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
306
- // TODO: enable keyboard to go to the next item in the list
307
- /* @__PURE__ */ import_react4.default.createElement(
308
- import_react_select.default,
309
- {
310
- noOptionsMessage: NoOption,
311
- classNames: {
312
- control: () => cn(
313
- props.phoneCode && "hawa-rounded-r-none",
314
- props.controlClassNames
315
- ),
316
- container: () => cn(
317
- selectContainerStyles,
318
- props.phoneCode && phoneCodeStyles,
319
- props.isMulti && "hawa-ps-0 "
320
- ),
321
- placeholder: () => cn(
322
- selectPlaceholderStyles,
323
- props.disabled && "hawa-text-muted-foreground"
324
- ),
325
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
326
- singleValue: () => cn(
327
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
328
- ),
329
- indicatorsContainer: () => cn(
330
- selectIndicatorContainerStyles,
331
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
332
- props.disabled && "hawa-opacity-30"
333
- )
334
- },
335
- unstyled: true,
336
- autoFocus: false,
337
- components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
293
+ props.isLoading ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ import_react4.default.createElement(
294
+ import_react_select.default,
295
+ {
296
+ noOptionsMessage: NoOption,
297
+ classNames: {
298
+ control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
299
+ container: () => cn(
300
+ selectContainerStyles,
301
+ props.phoneCode && phoneCodeStyles,
302
+ props.isMulti && "hawa-ps-0 "
303
+ ),
304
+ placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
305
+ valueContainer: () => "hawa-text-foreground hawa-px-1",
306
+ singleValue: () => cn(
307
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
308
+ ),
309
+ indicatorsContainer: () => cn(
310
+ selectIndicatorContainerStyles,
311
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
312
+ props.disabled && "hawa-opacity-30"
313
+ )
314
+ },
315
+ unstyled: true,
316
+ autoFocus: false,
317
+ components: props.hideIndicator ? {
318
+ Option: (optionProps) => /* @__PURE__ */ import_react4.default.createElement(
338
319
  Option,
339
- Menu,
340
- ValueContainer: (e) => /* @__PURE__ */ import_react4.default.createElement(
341
- "div",
342
- {
343
- className: cn(
344
- e.className,
345
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
346
- ),
347
- ...e
348
- }
349
- ),
350
- MultiValueContainer: (e) => /* @__PURE__ */ import_react4.default.createElement(
351
- "div",
352
- {
353
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
354
- ...e
355
- }
356
- )
357
- },
358
- onChange: (newValue, action) => props.onChange(newValue, action),
359
- options: props.options,
360
- getOptionLabel: props.getOptionLabel,
361
- defaultValue: props.defaultValue,
362
- value: props.value,
363
- placeholder: props.placeholder,
364
- isDisabled: props.disabled,
365
- isClearable: props.isClearable,
366
- isMulti: props.isMulti,
367
- isSearchable: props.isSearchable
368
- }
369
- )
320
+ {
321
+ ...optionProps,
322
+ isSelected: optionProps.data[valueKey] === props.value[valueKey]
323
+ }
324
+ ),
325
+ Menu,
326
+ IndicatorsContainer: () => null
327
+ } : {
328
+ Option,
329
+ Menu,
330
+ ValueContainer: (e) => /* @__PURE__ */ import_react4.default.createElement(
331
+ "div",
332
+ {
333
+ className: cn(
334
+ e.className,
335
+ "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
336
+ ),
337
+ ...e
338
+ }
339
+ ),
340
+ MultiValueContainer: (e) => /* @__PURE__ */ import_react4.default.createElement(
341
+ "div",
342
+ {
343
+ className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
344
+ ...e
345
+ }
346
+ )
347
+ },
348
+ onChange: (newValue, action) => props.onChange(newValue, action),
349
+ options: props.options,
350
+ getOptionLabel: props.getOptionLabel,
351
+ defaultValue: props.defaultValue,
352
+ value: props.value,
353
+ placeholder: props.placeholder,
354
+ isDisabled: props.disabled,
355
+ isClearable: props.isClearable,
356
+ isMulti: props.isMulti,
357
+ isSearchable: props.isSearchable
358
+ }
370
359
  ) : /* @__PURE__ */ import_react4.default.createElement(
371
360
  import_creatable.default,
372
361
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/select/index.ts","../../elements/select/Select.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Select\";","import React, { FC } from \"react\";\nimport ReactSelect, { MenuProps, OptionProps } from \"react-select\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { cn } from \"@util/index\";\nimport clsx from \"clsx\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ControlTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\n// The options container\ntype MenuTypes = MenuProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n};\n\n// The single options\ntype OptionTypes = OptionProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n isFocused: boolean;\n isSelected: boolean;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\nexport type SelectOptionProps = {\n value: any;\n label: any;\n};\n\ntype SelectTypes = {\n label?: string;\n hideHelperText?: boolean;\n options: SelectOptionProps[];\n labelKey?: string;\n isCreatable?: boolean;\n isClearable?: boolean;\n isMulti?: boolean;\n isSearchable?: boolean;\n controlClassNames?: string;\n containerClassNames?: string;\n onChange: any;\n helperText?: any;\n onInputChange?: any;\n native?: any;\n width?: \"full\" | \"small\" | \"fit\";\n value?: any;\n children?: any;\n getOptionLabel?: any;\n disabled?: boolean;\n defaultValue?: any;\n handleCreateOption?: () => void;\n placeholder?: string;\n hideIndicator?: boolean;\n phoneCode?: boolean;\n isLoading?: any;\n labelProps?: LabelProps;\n texts?: {\n noOptions?: string;\n createLabel?: string;\n };\n};\n\nexport const Select: FC<SelectTypes> = ({\n labelProps,\n labelKey = \"label\",\n ...props\n}) => {\n const NoOption = () => {\n return <div>{props.texts?.noOptions ?? \"No Items Found\"}</div>;\n };\n const Control: FC<ControlTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={clsx(\n \"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Option: FC<OptionTypes> = ({\n children,\n innerProps,\n innerRef,\n isFocused,\n isSelected,\n }) => {\n return (\n <div\n ref={innerRef}\n className={cn(\n \"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all\",\n isFocused\n ? \"hawa-bg-accent hawa-text-bg-accent-foreground\"\n : \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n isSelected && \"hawa-bg-primary hawa-text-primary-foreground\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Menu: FC<MenuTypes> = ({\n cx,\n children,\n getStyles,\n innerProps,\n innerRef,\n ...menuProps\n }) => {\n const menuOpen = menuProps.selectProps.menuIsOpen;\n return (\n <div\n className={cn(\n \"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md\",\n props.phoneCode ? \"hawa-p-1.5\" : \"hawa-w-full hawa-p-1.5\",\n menuOpen && \"hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95\",\n )}\n ref={innerRef}\n {...innerProps}\n // {...props}\n >\n {children}\n </div>\n );\n };\n\n let phoneCodeStyles =\n \"hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]\";\n let selectContainerStyles =\n \"hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm\";\n let selectPlaceholderStyles =\n \"hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1\";\n let selectIndicatorContainerStyles =\n \"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] \";\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {props.isLoading ? (\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n ) : !props.isCreatable ? (\n // TODO: enable keyboard to go to the next item in the list\n <ReactSelect\n noOptionsMessage={NoOption}\n classNames={{\n control: () =>\n cn(\n props.phoneCode && \"hawa-rounded-r-none\",\n props.controlClassNames,\n ),\n container: () =>\n cn(\n selectContainerStyles,\n props.phoneCode && phoneCodeStyles,\n\n props.isMulti && \"hawa-ps-0 \",\n ),\n placeholder: () =>\n cn(\n selectPlaceholderStyles,\n props.disabled && \"hawa-text-muted-foreground\",\n ),\n valueContainer: () => \"hawa-text-foreground hawa-px-1 \",\n singleValue: () =>\n cn(\n props.disabled\n ? \"hawa-text-muted-foreground hawa-opacity-30\"\n : \"hawa-text-foreground\",\n ),\n indicatorsContainer: () =>\n cn(\n selectIndicatorContainerStyles,\n props.hideIndicator ? \"hawa-invisible\" : \"hawa-px-1\",\n props.disabled && \"hawa-opacity-30\",\n ),\n }}\n unstyled\n autoFocus={false}\n components={\n props.hideIndicator\n ? { Option, Menu, IndicatorsContainer: () => null }\n : {\n Option,\n Menu,\n ValueContainer: (e) => (\n <div\n className={cn(\n e.className,\n \"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1\",\n )}\n {...e}\n />\n ),\n MultiValueContainer: (e) => (\n <div\n className=\"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row\"\n {...e}\n />\n ),\n }\n }\n onChange={(newValue: any, action) => props.onChange(newValue, action)}\n options={props.options}\n getOptionLabel={props.getOptionLabel}\n defaultValue={props.defaultValue}\n value={props.value}\n placeholder={props.placeholder}\n isDisabled={props.disabled}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n />\n ) : (\n <CreatableSelect\n formatCreateLabel={(inputValue) =>\n `${props.texts?.createLabel ?? \"Create\"} \"${inputValue}\"`\n }\n classNames={{\n container: () =>\n cn(\n \"hawa-rounded\",\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n ),\n placeholder: () => \"hawa-px-2 hawa-text-muted-foreground\",\n input: () => \"hawa-text-primary hawa-px-2\",\n valueContainer: () =>\n \"hawa-text-white dark:hawa-text-muted-foreground\",\n singleValue: () => \"hawa-text-black dark:hawa-text-white hawa-px-2\",\n indicatorsContainer: () =>\n \" hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground\",\n }}\n unstyled\n options={props.options}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n placeholder={props.placeholder}\n onCreateOption={props.handleCreateOption}\n onChange={(newValue, action) => props.onChange(newValue, action)}\n components={{ Control, Option, Menu }}\n onInputChange={(newValue, action) =>\n props.onInputChange(newValue, action)\n }\n />\n )}\n {!props.hideHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n as?: \"div\" | \"input\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n as = \"div\",\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n const styledAs = {\n div: \"\",\n input: \"hawa-h-[40px] hawa-w-full\",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content && \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n styledAs[as],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;;;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UACF,aAAa,MAAM;AAAA,UACnB,OAAO,MAAM;AAAA,UACb,gBAAgB,MACd;AAAA,UACF,aAAa,MAAM;AAAA,UACnB,qBAAqB,MACnB;AAAA,QACJ;AAAA,QACA,UAAQ;AAAA,QACR,SAAS,MAAM;AAAA,QACf,aAAa,MAAM;AAAA,QACnB,SAAS,MAAM;AAAA,QACf,cAAc,MAAM;AAAA,QACpB,aAAa,MAAM;AAAA,QACnB,gBAAgB,MAAM;AAAA,QACtB,UAAU,CAAC,UAAU,WAAW,MAAM,SAAS,UAAU,MAAM;AAAA,QAC/D,YAAY,EAAE,SAAS,QAAQ,KAAK;AAAA,QACpC,eAAe,CAAC,UAAU,WACxB,MAAM,cAAc,UAAU,MAAM;AAAA;AAAA,IAExC;AAAA,IAED,CAAC,MAAM,kBAAkB,8BAAAH,QAAA,cAAC,cAAW,YAAY,MAAM,YAAY;AAAA,EACtE;AAEJ;","names":["import_react","import_clsx","React","React","import_react","React","import_react","React","React","clsx","ReactSelect","CreatableSelect"]}
1
+ {"version":3,"sources":["../../elements/select/index.ts","../../elements/select/Select.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Select\";","import React, { FC } from \"react\";\nimport ReactSelect, { MenuProps, OptionProps } from \"react-select\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { cn } from \"@util/index\";\nimport clsx from \"clsx\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ControlTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\n// The options container\ntype MenuTypes = MenuProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n};\n\n// The single options\ntype OptionTypes = OptionProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n isFocused: boolean;\n isSelected: boolean;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\nexport type SelectOptionProps = {\n value: any;\n label: any;\n};\n\ntype SelectTypes = {\n label?: string;\n hideHelperText?: boolean;\n options: SelectOptionProps[];\n labelKey?: string;\n valueKey?: string;\n isCreatable?: boolean;\n isClearable?: boolean;\n isMulti?: boolean;\n isSearchable?: boolean;\n controlClassNames?: string;\n containerClassNames?: string;\n onChange: any;\n helperText?: any;\n onInputChange?: any;\n native?: any;\n width?: \"full\" | \"small\" | \"fit\";\n value?: any;\n children?: any;\n getOptionLabel?: any;\n disabled?: boolean;\n defaultValue?: any;\n handleCreateOption?: () => void;\n placeholder?: string;\n hideIndicator?: boolean;\n phoneCode?: boolean;\n isLoading?: any;\n labelProps?: LabelProps;\n texts?: {\n noOptions?: string;\n createLabel?: string;\n };\n};\n\nexport const Select: FC<SelectTypes> = ({\n labelProps,\n labelKey = \"label\",\n valueKey = \"value\",\n ...props\n}) => {\n const NoOption = () => {\n return <div>{props.texts?.noOptions ?? \"No Items Found\"}</div>;\n };\n const Control: FC<ControlTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={clsx(\n \"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Option: FC<OptionTypes> = ({ children, innerProps, innerRef, isFocused, isSelected }) => {\n return (\n <div\n ref={innerRef}\n className={cn(\n \"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all\",\n isFocused\n ? \"hawa-bg-accent hawa-text-bg-accent-foreground\"\n : \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n isSelected && \"hawa-bg-primary hawa-text-primary-foreground\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Menu: FC<MenuTypes> = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {\n const menuOpen = menuProps.selectProps.menuIsOpen;\n return (\n <div\n className={cn(\n \"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md\",\n props.phoneCode ? \"hawa-p-1.5\" : \"hawa-w-full hawa-p-1.5\",\n menuOpen && \"hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95\",\n )}\n ref={innerRef}\n {...innerProps}\n // {...props}\n >\n {children}\n </div>\n );\n };\n\n let phoneCodeStyles =\n \"hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]\";\n let selectContainerStyles =\n \"hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm\";\n let selectPlaceholderStyles = \"hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1\";\n let selectIndicatorContainerStyles =\n \"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] \";\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {props.isLoading ? (\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n ) : !props.isCreatable ? (\n <ReactSelect\n noOptionsMessage={NoOption}\n classNames={{\n control: () => cn(props.phoneCode && \"hawa-rounded-r-none\", props.controlClassNames),\n container: () =>\n cn(\n selectContainerStyles,\n props.phoneCode && phoneCodeStyles,\n props.isMulti && \"hawa-ps-0 \",\n ),\n placeholder: () =>\n cn(selectPlaceholderStyles, props.disabled && \"hawa-text-muted-foreground\"),\n valueContainer: () => \"hawa-text-foreground hawa-px-1\",\n singleValue: () =>\n cn(\n props.disabled\n ? \"hawa-text-muted-foreground hawa-opacity-30\"\n : \"hawa-text-foreground\",\n ),\n indicatorsContainer: () =>\n cn(\n selectIndicatorContainerStyles,\n props.hideIndicator ? \"hawa-invisible\" : \"hawa-px-1\",\n props.disabled && \"hawa-opacity-30\",\n ),\n }}\n unstyled\n autoFocus={false}\n components={\n props.hideIndicator\n ? {\n Option: (optionProps) => (\n <Option\n {...optionProps}\n isSelected={optionProps.data[valueKey] === props.value[valueKey]}\n />\n ),\n Menu,\n IndicatorsContainer: () => null,\n }\n : {\n Option,\n Menu,\n ValueContainer: (e) => (\n <div\n className={cn(\n e.className,\n \"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer\",\n )}\n {...e}\n />\n ),\n MultiValueContainer: (e) => (\n <div\n className=\"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row\"\n {...e}\n />\n ),\n }\n }\n onChange={(newValue: any, action) => props.onChange(newValue, action)}\n options={props.options}\n getOptionLabel={props.getOptionLabel}\n defaultValue={props.defaultValue}\n value={props.value}\n placeholder={props.placeholder}\n isDisabled={props.disabled}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n />\n ) : (\n <CreatableSelect\n formatCreateLabel={(inputValue) =>\n `${props.texts?.createLabel ?? \"Create\"} \"${inputValue}\"`\n }\n classNames={{\n container: () =>\n cn(\n \"hawa-rounded\",\n props.disabled ? \"hawa-cursor-not-allowed\" : \"hawa-cursor-pointer\",\n ),\n placeholder: () => \"hawa-px-2 hawa-text-muted-foreground\",\n input: () => \"hawa-text-primary hawa-px-2\",\n valueContainer: () => \"hawa-text-white dark:hawa-text-muted-foreground\",\n singleValue: () => \"hawa-text-black dark:hawa-text-white hawa-px-2\",\n indicatorsContainer: () => \" hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground\",\n }}\n unstyled\n options={props.options}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n placeholder={props.placeholder}\n onCreateOption={props.handleCreateOption}\n onChange={(newValue, action) => props.onChange(newValue, action)}\n components={{ Control, Option, Menu }}\n onInputChange={(newValue, action) => props.onInputChange(newValue, action)}\n />\n )}\n {!props.hideHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n as?: \"div\" | \"input\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n as = \"div\",\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n const styledAs = {\n div: \"\",\n input: \"hawa-h-[40px] hawa-w-full\",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content && \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n styledAs[as],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA0B;AAC1B,0BAAoD;AACpD,uBAA4B;;;ACF5B,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAAC,eAAiB;;;AELjB,mBAAkB;AAIX,IAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAGE,6BAAAC,QAAA;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B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ACtB,UAAU,CAAC,UAAU,WAAW,MAAM,SAAS,UAAU,MAAM;AAAA,QAC/D,YAAY,EAAE,SAAS,QAAQ,KAAK;AAAA,QACpC,eAAe,CAAC,UAAU,WAAW,MAAM,cAAc,UAAU,MAAM;AAAA;AAAA,IAC3E;AAAA,IAED,CAAC,MAAM,kBAAkB,8BAAAH,QAAA,cAAC,cAAW,YAAY,MAAM,YAAY;AAAA,EACtE;AAEJ;","names":["import_react","import_clsx","React","React","import_react","React","import_react","React","React","clsx","ReactSelect","CreatableSelect"]}