@sikka/hawa 0.37.2-next → 0.38.1-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 (168) hide show
  1. package/dist/{Radio-y9uhxitu.d.ts → Radio-lgoClQrv.d.ts} +2 -2
  2. package/dist/{Radio-BCD7k628.d.mts → Radio-uQ7DtzcI.d.mts} +2 -2
  3. package/dist/alert/index.js +43 -19
  4. package/dist/alert/index.js.map +1 -1
  5. package/dist/alert/index.mjs +43 -19
  6. package/dist/alert/index.mjs.map +1 -1
  7. package/dist/appLayout/index.js +43 -19
  8. package/dist/appLayout/index.js.map +1 -1
  9. package/dist/appLayout/index.mjs +43 -19
  10. package/dist/appLayout/index.mjs.map +1 -1
  11. package/dist/backToTop/index.js +43 -19
  12. package/dist/backToTop/index.js.map +1 -1
  13. package/dist/backToTop/index.mjs +43 -19
  14. package/dist/backToTop/index.mjs.map +1 -1
  15. package/dist/blocks/auth/index.d.mts +1 -0
  16. package/dist/blocks/auth/index.d.ts +1 -0
  17. package/dist/blocks/auth/index.js +251 -143
  18. package/dist/blocks/auth/index.mjs +205 -102
  19. package/dist/blocks/feedback/index.js +47 -59
  20. package/dist/blocks/feedback/index.mjs +5 -5
  21. package/dist/blocks/index.d.mts +2 -1
  22. package/dist/blocks/index.d.ts +2 -1
  23. package/dist/blocks/index.js +501 -420
  24. package/dist/blocks/index.mjs +11 -9
  25. package/dist/blocks/misc/index.js +48 -51
  26. package/dist/blocks/misc/index.mjs +5 -5
  27. package/dist/blocks/pricing/index.js +47 -41
  28. package/dist/blocks/pricing/index.mjs +4 -4
  29. package/dist/button/index.d.mts +4 -0
  30. package/dist/button/index.d.ts +4 -0
  31. package/dist/button/index.js +43 -19
  32. package/dist/button/index.js.map +1 -1
  33. package/dist/button/index.mjs +43 -19
  34. package/dist/button/index.mjs.map +1 -1
  35. package/dist/calendar/index.js +43 -19
  36. package/dist/calendar/index.js.map +1 -1
  37. package/dist/calendar/index.mjs +43 -19
  38. package/dist/calendar/index.mjs.map +1 -1
  39. package/dist/checkbox/index.d.mts +1 -1
  40. package/dist/checkbox/index.d.ts +1 -1
  41. package/dist/checkbox/index.js.map +1 -1
  42. package/dist/checkbox/index.mjs.map +1 -1
  43. package/dist/{chunk-ZTUWU652.mjs → chunk-EZBHA2IL.mjs} +3 -3
  44. package/dist/{chunk-ODOCZAWC.mjs → chunk-F23GAE2P.mjs} +1 -1
  45. package/dist/{chunk-DS3AACQJ.mjs → chunk-IC5WYNKN.mjs} +1 -1
  46. package/dist/{chunk-QXH7ZDMN.mjs → chunk-RTK6REIK.mjs} +3 -11
  47. package/dist/{chunk-QYWOI3DO.mjs → chunk-UDJFVH2I.mjs} +204 -144
  48. package/dist/{chunk-BPHQFAWM.mjs → chunk-UJ5SXC3M.mjs} +3 -11
  49. package/dist/{chunk-PXGL7ZXQ.mjs → chunk-UMOBOCED.mjs} +44 -19
  50. package/dist/{chunk-RNFJAEEU.mjs → chunk-V7O5MQZQ.mjs} +44 -19
  51. package/dist/{chunk-BTDR3VAG.mjs → chunk-WDCKXU54.mjs} +4 -21
  52. package/dist/{chunk-MDHDHEPZ.mjs → chunk-XFSBC5VI.mjs} +3 -11
  53. package/dist/codeBlock/index.js +43 -19
  54. package/dist/codeBlock/index.js.map +1 -1
  55. package/dist/codeBlock/index.mjs +43 -19
  56. package/dist/codeBlock/index.mjs.map +1 -1
  57. package/dist/colorPicker/index.d.mts +1 -1
  58. package/dist/colorPicker/index.d.ts +1 -1
  59. package/dist/colorPicker/index.js +35 -31
  60. package/dist/colorPicker/index.js.map +1 -1
  61. package/dist/colorPicker/index.mjs +33 -29
  62. package/dist/colorPicker/index.mjs.map +1 -1
  63. package/dist/combobox/index.d.mts +1 -1
  64. package/dist/combobox/index.d.ts +1 -1
  65. package/dist/combobox/index.js +52 -48
  66. package/dist/combobox/index.js.map +1 -1
  67. package/dist/combobox/index.mjs +52 -48
  68. package/dist/combobox/index.mjs.map +1 -1
  69. package/dist/dataTable/index.js +44 -29
  70. package/dist/dataTable/index.js.map +1 -1
  71. package/dist/dataTable/index.mjs +44 -29
  72. package/dist/dataTable/index.mjs.map +1 -1
  73. package/dist/datePicker/index.d.mts +4 -0
  74. package/dist/datePicker/index.d.ts +4 -0
  75. package/dist/datePicker/index.js +44 -19
  76. package/dist/datePicker/index.js.map +1 -1
  77. package/dist/datePicker/index.mjs +44 -19
  78. package/dist/datePicker/index.mjs.map +1 -1
  79. package/dist/docsLayout/index.js +43 -19
  80. package/dist/docsLayout/index.js.map +1 -1
  81. package/dist/docsLayout/index.mjs +43 -19
  82. package/dist/docsLayout/index.mjs.map +1 -1
  83. package/dist/elements/index.d.mts +46 -21
  84. package/dist/elements/index.d.ts +46 -21
  85. package/dist/elements/index.js +378 -309
  86. package/dist/elements/index.mjs +14 -23
  87. package/dist/fileDropzone/index.js +43 -19
  88. package/dist/fileDropzone/index.js.map +1 -1
  89. package/dist/fileDropzone/index.mjs +43 -19
  90. package/dist/fileDropzone/index.mjs.map +1 -1
  91. package/dist/index.css +29 -3
  92. package/dist/index.d.mts +48 -22
  93. package/dist/index.d.ts +48 -22
  94. package/dist/index.js +808 -737
  95. package/dist/index.mjs +331 -264
  96. package/dist/input/index.d.mts +1 -1
  97. package/dist/input/index.d.ts +1 -1
  98. package/dist/input/index.js +46 -42
  99. package/dist/input/index.js.map +1 -1
  100. package/dist/input/index.mjs +45 -41
  101. package/dist/input/index.mjs.map +1 -1
  102. package/dist/interfaceSettings/index.js +64 -69
  103. package/dist/interfaceSettings/index.js.map +1 -1
  104. package/dist/interfaceSettings/index.mjs +57 -62
  105. package/dist/interfaceSettings/index.mjs.map +1 -1
  106. package/dist/layout/index.d.mts +1 -1
  107. package/dist/layout/index.d.ts +1 -1
  108. package/dist/layout/index.js +43 -19
  109. package/dist/layout/index.mjs +2 -2
  110. package/dist/passwordInput/index.js +70 -66
  111. package/dist/passwordInput/index.js.map +1 -1
  112. package/dist/passwordInput/index.mjs +59 -55
  113. package/dist/passwordInput/index.mjs.map +1 -1
  114. package/dist/phoneInput/index.js +50 -55
  115. package/dist/phoneInput/index.js.map +1 -1
  116. package/dist/phoneInput/index.mjs +47 -52
  117. package/dist/phoneInput/index.mjs.map +1 -1
  118. package/dist/pinInput/index.d.mts +37 -16
  119. package/dist/pinInput/index.d.ts +37 -16
  120. package/dist/pinInput/index.js +208 -78
  121. package/dist/pinInput/index.js.map +1 -1
  122. package/dist/pinInput/index.mjs +203 -77
  123. package/dist/pinInput/index.mjs.map +1 -1
  124. package/dist/radio/index.d.mts +1 -1
  125. package/dist/radio/index.d.ts +1 -1
  126. package/dist/radio/index.js +55 -60
  127. package/dist/radio/index.js.map +1 -1
  128. package/dist/radio/index.mjs +50 -55
  129. package/dist/radio/index.mjs.map +1 -1
  130. package/dist/scrollArea/index.js +2 -2
  131. package/dist/scrollArea/index.js.map +1 -1
  132. package/dist/scrollArea/index.mjs +2 -2
  133. package/dist/scrollArea/index.mjs.map +1 -1
  134. package/dist/select/index.d.mts +1 -1
  135. package/dist/select/index.d.ts +1 -1
  136. package/dist/select/index.js +43 -39
  137. package/dist/select/index.js.map +1 -1
  138. package/dist/select/index.mjs +43 -39
  139. package/dist/select/index.mjs.map +1 -1
  140. package/dist/signature/index.d.mts +1 -1
  141. package/dist/signature/index.d.ts +1 -1
  142. package/dist/signature/index.js.map +1 -1
  143. package/dist/signature/index.mjs.map +1 -1
  144. package/dist/sortButton/index.js +43 -19
  145. package/dist/sortButton/index.js.map +1 -1
  146. package/dist/sortButton/index.mjs +43 -19
  147. package/dist/sortButton/index.mjs.map +1 -1
  148. package/dist/splitButton/index.d.mts +4 -0
  149. package/dist/splitButton/index.d.ts +4 -0
  150. package/dist/splitButton/index.js +43 -19
  151. package/dist/splitButton/index.js.map +1 -1
  152. package/dist/splitButton/index.mjs +43 -19
  153. package/dist/splitButton/index.mjs.map +1 -1
  154. package/dist/stats/index.d.mts +1 -1
  155. package/dist/stats/index.d.ts +1 -1
  156. package/dist/stats/index.js.map +1 -1
  157. package/dist/stats/index.mjs.map +1 -1
  158. package/dist/tabs/index.js +2 -2
  159. package/dist/tabs/index.js.map +1 -1
  160. package/dist/tabs/index.mjs +2 -2
  161. package/dist/tabs/index.mjs.map +1 -1
  162. package/dist/textarea/index.d.mts +1 -1
  163. package/dist/textarea/index.d.ts +1 -1
  164. package/dist/textarea/index.js +34 -30
  165. package/dist/textarea/index.js.map +1 -1
  166. package/dist/textarea/index.mjs +34 -30
  167. package/dist/textarea/index.mjs.map +1 -1
  168. package/package.json +2 -1
@@ -1,20 +1,41 @@
1
- import React__default, { FC } from 'react';
1
+ import * as input_otp from 'input-otp';
2
+ import { OTPInputProps } from 'input-otp';
3
+ import * as React from 'react';
2
4
 
3
- type PinInputTypes = {
4
- /** Label text to display for the Pin Input */
5
- label?: string;
6
- /** Icon element to be displayed next to the Pin Input */
7
- icon?: JSX.Element;
8
- /** Number of digits in the Pin Input */
9
- digits: number;
10
- /** Width of the Pin Input - either 'normal' or 'full' */
11
- width?: "normal" | "full";
12
- /** Function to get the value of pins */
13
- getPins?: (pins: string[]) => void;
14
- /** The small red text under the input field to show validation or a hint. */
5
+ declare const PinInputRoot: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "maxLength" | "value" | "onChange" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
6
+ value?: string | undefined;
7
+ onChange?: ((newValue: string) => unknown) | undefined;
8
+ maxLength: number;
9
+ textAlign?: "center" | "left" | "right" | undefined;
10
+ onComplete?: ((...args: any[]) => unknown) | undefined;
11
+ pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
12
+ containerClassName?: string | undefined;
13
+ noScriptCSSFallback?: string | null | undefined;
14
+ } & {
15
+ render: (props: input_otp.RenderProps) => React.ReactNode;
16
+ children?: undefined;
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "maxLength" | "value" | "onChange" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
18
+ value?: string | undefined;
19
+ onChange?: ((newValue: string) => unknown) | undefined;
20
+ maxLength: number;
21
+ textAlign?: "center" | "left" | "right" | undefined;
22
+ onComplete?: ((...args: any[]) => unknown) | undefined;
23
+ pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
24
+ containerClassName?: string | undefined;
25
+ noScriptCSSFallback?: string | null | undefined;
26
+ } & {
27
+ render?: undefined;
28
+ children: React.ReactNode;
29
+ } & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
30
+ declare const PinInputGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
31
+ declare const PinInputSlot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
32
+ index: number;
33
+ } & React.RefAttributes<HTMLDivElement>>;
34
+ declare const PinInputSeperator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
35
+ type PinInputProps = Omit<OTPInputProps, "render"> & {
36
+ separatorPosition?: number;
15
37
  helperText?: any;
16
- inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
17
38
  };
18
- declare const PinInput: FC<PinInputTypes>;
39
+ declare const PinInput: React.FC<PinInputProps>;
19
40
 
20
- export { PinInput };
41
+ export { PinInput, PinInputGroup, PinInputRoot, PinInputSeperator, PinInputSlot };
@@ -1,20 +1,41 @@
1
- import React__default, { FC } from 'react';
1
+ import * as input_otp from 'input-otp';
2
+ import { OTPInputProps } from 'input-otp';
3
+ import * as React from 'react';
2
4
 
3
- type PinInputTypes = {
4
- /** Label text to display for the Pin Input */
5
- label?: string;
6
- /** Icon element to be displayed next to the Pin Input */
7
- icon?: JSX.Element;
8
- /** Number of digits in the Pin Input */
9
- digits: number;
10
- /** Width of the Pin Input - either 'normal' or 'full' */
11
- width?: "normal" | "full";
12
- /** Function to get the value of pins */
13
- getPins?: (pins: string[]) => void;
14
- /** The small red text under the input field to show validation or a hint. */
5
+ declare const PinInputRoot: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "maxLength" | "value" | "onChange" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
6
+ value?: string | undefined;
7
+ onChange?: ((newValue: string) => unknown) | undefined;
8
+ maxLength: number;
9
+ textAlign?: "center" | "left" | "right" | undefined;
10
+ onComplete?: ((...args: any[]) => unknown) | undefined;
11
+ pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
12
+ containerClassName?: string | undefined;
13
+ noScriptCSSFallback?: string | null | undefined;
14
+ } & {
15
+ render: (props: input_otp.RenderProps) => React.ReactNode;
16
+ children?: undefined;
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "maxLength" | "value" | "onChange" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
18
+ value?: string | undefined;
19
+ onChange?: ((newValue: string) => unknown) | undefined;
20
+ maxLength: number;
21
+ textAlign?: "center" | "left" | "right" | undefined;
22
+ onComplete?: ((...args: any[]) => unknown) | undefined;
23
+ pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
24
+ containerClassName?: string | undefined;
25
+ noScriptCSSFallback?: string | null | undefined;
26
+ } & {
27
+ render?: undefined;
28
+ children: React.ReactNode;
29
+ } & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
30
+ declare const PinInputGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
31
+ declare const PinInputSlot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
32
+ index: number;
33
+ } & React.RefAttributes<HTMLDivElement>>;
34
+ declare const PinInputSeperator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
35
+ type PinInputProps = Omit<OTPInputProps, "render"> & {
36
+ separatorPosition?: number;
15
37
  helperText?: any;
16
- inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
17
38
  };
18
- declare const PinInput: FC<PinInputTypes>;
39
+ declare const PinInput: React.FC<PinInputProps>;
19
40
 
20
- export { PinInput };
41
+ export { PinInput, PinInputGroup, PinInputRoot, PinInputSeperator, PinInputSlot };
@@ -31,12 +31,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // elements/pinInput/index.ts
32
32
  var pinInput_exports = {};
33
33
  __export(pinInput_exports, {
34
- PinInput: () => PinInput
34
+ PinInput: () => PinInput,
35
+ PinInputGroup: () => PinInputGroup,
36
+ PinInputRoot: () => PinInputRoot,
37
+ PinInputSeperator: () => PinInputSeperator,
38
+ PinInputSlot: () => PinInputSlot
35
39
  });
36
40
  module.exports = __toCommonJS(pinInput_exports);
37
41
 
38
42
  // elements/pinInput/PinInput.tsx
39
- var import_react = __toESM(require("react"));
43
+ var React2 = __toESM(require("react"));
40
44
 
41
45
  // util/index.ts
42
46
  var import_clsx = require("clsx");
@@ -46,88 +50,214 @@ function cn(...inputs) {
46
50
  }
47
51
 
48
52
  // elements/pinInput/PinInput.tsx
49
- var PinInput = ({
50
- label,
51
- icon,
52
- digits,
53
- width = "normal",
54
- getPins,
55
- inputProps,
56
- ...props
57
- }) => {
58
- const [pin, setPin] = (0, import_react.useState)(Array.from(Array(digits)));
59
- const handleKeyDown = (e, index) => {
60
- let backTo = 0;
61
- if (e.key === "Backspace") {
62
- e.target.value.length === 0 ? backTo = index - 1 : backTo = index;
63
- const previousInput = document.getElementById(`input-${backTo}`);
64
- previousInput == null ? void 0 : previousInput.focus();
65
- }
66
- };
67
- (0, import_react.useEffect)(() => {
68
- let unfilled = pin.includes(void 0);
69
- if (!unfilled && getPins) {
70
- getPins(pin);
71
- }
72
- });
73
- const handleChange = (e, index) => {
74
- if (!/^\d*$/.test(e.target.value)) {
75
- const newPin = [...pin];
76
- newPin[index] = "";
77
- setPin(newPin);
78
- return;
79
- } else {
80
- const newPin = [...pin];
81
- newPin[index] = e.target.value;
82
- setPin(newPin);
83
- if (e.target.value.length === 1) {
84
- const nextInput = document.getElementById(`input-${index + 1}`);
85
- nextInput == null ? void 0 : nextInput.focus();
86
- } else if (e.target.value.length === 0) {
87
- const previousInput = document.getElementById(`input-${index - 1}`);
88
- previousInput == null ? void 0 : previousInput.focus();
89
- }
90
- }
91
- };
92
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ import_react.default.createElement(
93
- "div",
94
- {
95
- className: "hawa-flex hawa-w-full hawa-flex-row hawa-justify-center hawa-gap-2",
96
- dir: "ltr"
97
- },
98
- pin.map((value, index) => /* @__PURE__ */ import_react.default.createElement(
99
- "input",
53
+ var import_input_otp = require("input-otp");
54
+
55
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
56
+ var import_react2 = require("react");
57
+
58
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
59
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
60
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
61
+ return Boolean(className) && array.indexOf(className) === index;
62
+ }).join(" ");
63
+
64
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
65
+ var import_react = require("react");
66
+
67
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
68
+ var defaultAttributes = {
69
+ xmlns: "http://www.w3.org/2000/svg",
70
+ width: 24,
71
+ height: 24,
72
+ viewBox: "0 0 24 24",
73
+ fill: "none",
74
+ stroke: "currentColor",
75
+ strokeWidth: 2,
76
+ strokeLinecap: "round",
77
+ strokeLinejoin: "round"
78
+ };
79
+
80
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
81
+ var Icon = (0, import_react.forwardRef)(
82
+ ({
83
+ color = "currentColor",
84
+ size = 24,
85
+ strokeWidth = 2,
86
+ absoluteStrokeWidth,
87
+ className = "",
88
+ children,
89
+ iconNode,
90
+ ...rest
91
+ }, ref) => {
92
+ return (0, import_react.createElement)(
93
+ "svg",
100
94
  {
101
- key: index,
102
- type: "text",
103
- maxLength: 1,
104
- value,
105
- inputMode: "numeric",
106
- id: `input-${index}`,
107
- pattern: "[0-9]*",
108
- className: cn(
109
- "hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center placeholder:hawa-text-muted-foreground",
110
- width === "full" ? "hawa-w-full" : "hawa-w-10"
111
- ),
112
- onChange: (e) => handleChange(e, index),
113
- onKeyDown: (e) => handleKeyDown(e, index),
114
- onFocus: (e) => e.target.select(),
115
- ...inputProps
116
- }
117
- ))
118
- ), /* @__PURE__ */ import_react.default.createElement(
119
- "p",
95
+ ref,
96
+ ...defaultAttributes,
97
+ width: size,
98
+ height: size,
99
+ stroke: color,
100
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
101
+ className: mergeClasses("lucide", className),
102
+ ...rest
103
+ },
104
+ [
105
+ ...iconNode.map(([tag, attrs]) => (0, import_react.createElement)(tag, attrs)),
106
+ ...Array.isArray(children) ? children : [children]
107
+ ]
108
+ );
109
+ }
110
+ );
111
+
112
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
113
+ var createLucideIcon = (iconName, iconNode) => {
114
+ const Component = (0, import_react2.forwardRef)(
115
+ ({ className, ...props }, ref) => (0, import_react2.createElement)(Icon, {
116
+ ref,
117
+ iconNode,
118
+ className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
119
+ ...props
120
+ })
121
+ );
122
+ Component.displayName = `${iconName}`;
123
+ return Component;
124
+ };
125
+
126
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
127
+ var Dot = createLucideIcon("Dot", [
128
+ ["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
129
+ ]);
130
+
131
+ // elements/helperText/HelperText.tsx
132
+ var import_react3 = __toESM(require("react"));
133
+ var HelperText = ({ helperText }) => /* @__PURE__ */ import_react3.default.createElement(
134
+ "p",
135
+ {
136
+ className: cn(
137
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
138
+ helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
139
+ )
140
+ },
141
+ helperText
142
+ );
143
+
144
+ // elements/pinInput/PinInput.tsx
145
+ var PinInputRoot = React2.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React2.createElement(
146
+ import_input_otp.OTPInput,
147
+ {
148
+ ref,
149
+ containerClassName: cn(
150
+ "hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50",
151
+ containerClassName
152
+ ),
153
+ className: cn("disabled:hawa-cursor-not-allowed", className),
154
+ ...props
155
+ }
156
+ ));
157
+ PinInputRoot.displayName = "PinInputRoot";
158
+ var PinInputGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
159
+ "div",
160
+ {
161
+ ref,
162
+ className: cn("hawa-flex hawa-items-center", className),
163
+ ...props
164
+ }
165
+ ));
166
+ PinInputGroup.displayName = "PinInputGroup";
167
+ var PinInputSlot = React2.forwardRef(({ index, className, ...props }, ref) => {
168
+ const pinInputContext = React2.useContext(import_input_otp.OTPInputContext);
169
+ const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
170
+ return /* @__PURE__ */ React2.createElement(
171
+ "div",
120
172
  {
173
+ ref,
121
174
  className: cn(
122
- "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
123
- props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
124
- )
175
+ "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",
176
+ isActive && "hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2",
177
+ className
178
+ ),
179
+ ...props
125
180
  },
126
- props.helperText
127
- ));
181
+ char,
182
+ hasFakeCaret && /* @__PURE__ */ React2.createElement("div", { className: "hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React2.createElement("div", { className: "hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000" }))
183
+ );
184
+ });
185
+ PinInputSlot.displayName = "PinInputSlot";
186
+ var PinInputSeperator = React2.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React2.createElement(Dot, null)));
187
+ PinInputSeperator.displayName = "PinInputSeperator";
188
+ var PinInput = ({
189
+ separatorPosition = 0,
190
+ ...props
191
+ }) => {
192
+ const maxLength = props.maxLength || 6;
193
+ const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
194
+ const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
195
+ const secondGroupLength = maxLength - firstGroupLength;
196
+ 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" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React2.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(
197
+ PinInputSlot,
198
+ {
199
+ key: index + firstGroupLength,
200
+ index: index + firstGroupLength,
201
+ className: "hawa-w-full"
202
+ }
203
+ )))), /* @__PURE__ */ React2.createElement(HelperText, { helperText: props.helperText }));
128
204
  };
129
205
  // Annotate the CommonJS export names for ESM import in node:
130
206
  0 && (module.exports = {
131
- PinInput
207
+ PinInput,
208
+ PinInputGroup,
209
+ PinInputRoot,
210
+ PinInputSeperator,
211
+ PinInputSlot
132
212
  });
213
+ /*! Bundled license information:
214
+
215
+ lucide-react/dist/esm/shared/src/utils.js:
216
+ (**
217
+ * @license lucide-react v0.379.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ *)
222
+
223
+ lucide-react/dist/esm/defaultAttributes.js:
224
+ (**
225
+ * @license lucide-react v0.379.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ *)
230
+
231
+ lucide-react/dist/esm/Icon.js:
232
+ (**
233
+ * @license lucide-react v0.379.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ *)
238
+
239
+ lucide-react/dist/esm/createLucideIcon.js:
240
+ (**
241
+ * @license lucide-react v0.379.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ *)
246
+
247
+ lucide-react/dist/esm/icons/dot.js:
248
+ (**
249
+ * @license lucide-react v0.379.0 - ISC
250
+ *
251
+ * This source code is licensed under the ISC license.
252
+ * See the LICENSE file in the root directory of this source tree.
253
+ *)
254
+
255
+ lucide-react/dist/esm/lucide-react.js:
256
+ (**
257
+ * @license lucide-react v0.379.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ *)
262
+ */
133
263
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/pinInput/index.ts","../../elements/pinInput/PinInput.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./PinInput\";\n","import React, { useEffect, useState, FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype PinInputTypes = {\n /** Label text to display for the Pin Input */\n label?: string;\n /** Icon element to be displayed next to the Pin Input */\n icon?: JSX.Element;\n /** Number of digits in the Pin Input */\n digits: number;\n /** Width of the Pin Input - either 'normal' or 'full' */\n width?: \"normal\" | \"full\";\n /** Function to get the value of pins */\n getPins?: (pins: string[]) => void;\n /** The small red text under the input field to show validation or a hint. */\n helperText?: any;\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n};\n\nexport const PinInput: FC<PinInputTypes> = ({\n label,\n icon,\n digits,\n width = \"normal\",\n getPins,\n inputProps,\n ...props\n}) => {\n const [pin, setPin] = useState(Array.from(Array(digits)));\n\n const handleKeyDown = (e: any, index: any) => {\n let backTo = 0;\n if (e.key === \"Backspace\") {\n e.target.value.length === 0 ? (backTo = index - 1) : (backTo = index);\n const previousInput = document.getElementById(`input-${backTo}`);\n previousInput?.focus();\n }\n };\n useEffect(() => {\n let unfilled = pin.includes(undefined);\n if (!unfilled && getPins) {\n getPins(pin);\n }\n });\n const handleChange = (e: any, index: any) => {\n if (!/^\\d*$/.test(e.target.value)) {\n const newPin = [...pin];\n newPin[index] = \"\";\n setPin(newPin);\n return;\n } else {\n const newPin = [...pin];\n newPin[index] = e.target.value;\n setPin(newPin);\n\n if (e.target.value.length === 1) {\n const nextInput = document.getElementById(`input-${index + 1}`);\n nextInput?.focus();\n } else if (e.target.value.length === 0) {\n const previousInput = document.getElementById(`input-${index - 1}`);\n previousInput?.focus();\n }\n }\n };\n\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n <div\n className=\"hawa-flex hawa-w-full hawa-flex-row hawa-justify-center hawa-gap-2\"\n dir=\"ltr\"\n >\n {pin.map((value, index) => (\n <input\n key={index}\n type=\"text\"\n maxLength={1}\n value={value}\n inputMode=\"numeric\"\n id={`input-${index}`}\n pattern=\"[0-9]*\"\n className={cn(\n \"hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center placeholder:hawa-text-muted-foreground\",\n width === \"full\" ? \"hawa-w-full\" : \"hawa-w-10\"\n )}\n onChange={(e) => handleChange(e, index)}\n onKeyDown={(e) => handleKeyDown(e, index)}\n onFocus={(e) => e.target.select()}\n {...inputProps}\n />\n ))}\n </div>\n\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n props.helperText\n ? \"hawa-h-4 hawa-opacity-100\"\n : \"hawa-h-0 hawa-opacity-0\"\n )}\n >\n {props.helperText}\n </p>\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA+C;;;ACA/C,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADeO,IAAM,WAA8B,CAAC;AAAA,EAC1C;AAAA,EACA;AAA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6BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,MAAK;AAAA,QACL,WAAW;AAAA,QACX;AAAA,QACA,WAAU;AAAA,QACV,IAAI,SAAS,KAAK;AAAA,QAClB,SAAQ;AAAA,QACR,WAAW;AAAA,UACT;AAAA,UACA,UAAU,SAAS,gBAAgB;AAAA,QACrC;AAAA,QACA,UAAU,CAAC,MAAM,aAAa,GAAG,KAAK;AAAA,QACtC,WAAW,CAAC,MAAM,cAAc,GAAG,KAAK;AAAA,QACxC,SAAS,CAAC,MAAM,EAAE,OAAO,OAAO;AAAA,QAC/B,GAAG;AAAA;AAAA,IACN,CACD;AAAA,EACH,GAEA,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,MAAM,aACF,8BACA;AAAA,MACN;AAAA;AAAA,IAEC,MAAM;AAAA,EACT,CACF;AAEJ;","names":["React"]}
1
+ {"version":3,"sources":["../../elements/pinInput/index.ts","../../elements/pinInput/PinInput.tsx","../../util/index.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/shared/src/utils.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/src/defaultAttributes.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/src/Icon.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/src/createLucideIcon.ts","../../../../node_modules/.pnpm/lucide-react@0.379.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\">\n {[...Array(firstGroupLength)].map((_, index) => (\n <PinInputSlot key={index} index={index} className=\"hawa-w-full\" />\n ))}\n </PinInputGroup>\n )}\n {separatorPosition > 0 && separatorPosition < props.maxLength && (\n <PinInputSeperator />\n )}\n {secondGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full\">\n {[...Array(secondGroupLength)].map((_, index) => (\n <PinInputSlot\n key={index + firstGroupLength}\n index={index + firstGroupLength}\n className=\"hawa-w-full\"\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 = ({ helperText }: { helperText?: any }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n helperText ? \"hawa-h-4 hawa-opacity-100\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n"],"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,QACG;AACI,eAAA;MACL;MACA;QACE;QACA,GAAG;QACH,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,aAAa,sBAAuB,OAAO,WAAW,IAAI,KAAM,OAAO,IAAI,IAAI;QAC/E,WAAW,aAAa,UAAU,SAAS;QAC3C,GAAG;MACL;MACA;QACE,GAAG,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,UAAM,4BAAc,KAAK,KAAK,CAAC;QAC3D,GAAI,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ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