@sikka/hawa 0.37.1-next → 0.38.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 (147) 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.map +1 -1
  4. package/dist/alert/index.mjs.map +1 -1
  5. package/dist/appLayout/index.js.map +1 -1
  6. package/dist/appLayout/index.mjs.map +1 -1
  7. package/dist/backToTop/index.js.map +1 -1
  8. package/dist/backToTop/index.mjs.map +1 -1
  9. package/dist/blocks/auth/index.d.mts +1 -0
  10. package/dist/blocks/auth/index.d.ts +1 -0
  11. package/dist/blocks/auth/index.js +207 -123
  12. package/dist/blocks/auth/index.mjs +204 -101
  13. package/dist/blocks/feedback/index.js +4 -40
  14. package/dist/blocks/feedback/index.mjs +5 -5
  15. package/dist/blocks/index.d.mts +2 -1
  16. package/dist/blocks/index.d.ts +2 -1
  17. package/dist/blocks/index.js +457 -400
  18. package/dist/blocks/index.mjs +10 -8
  19. package/dist/blocks/misc/index.js +5 -32
  20. package/dist/blocks/misc/index.mjs +5 -5
  21. package/dist/blocks/pricing/index.js +4 -22
  22. package/dist/blocks/pricing/index.mjs +4 -4
  23. package/dist/button/index.js.map +1 -1
  24. package/dist/button/index.mjs.map +1 -1
  25. package/dist/calendar/index.js.map +1 -1
  26. package/dist/calendar/index.mjs.map +1 -1
  27. package/dist/checkbox/index.d.mts +1 -1
  28. package/dist/checkbox/index.d.ts +1 -1
  29. package/dist/checkbox/index.js.map +1 -1
  30. package/dist/checkbox/index.mjs.map +1 -1
  31. package/dist/{chunk-BPHQFAWM.mjs → chunk-4EZL2A64.mjs} +3 -11
  32. package/dist/{chunk-DS3AACQJ.mjs → chunk-E6C3LDHD.mjs} +1 -1
  33. package/dist/{chunk-ODOCZAWC.mjs → chunk-E77TUADR.mjs} +1 -1
  34. package/dist/{chunk-QXH7ZDMN.mjs → chunk-IA5FLRFL.mjs} +3 -11
  35. package/dist/{chunk-ZTUWU652.mjs → chunk-JJMRBD3S.mjs} +3 -3
  36. package/dist/{chunk-RNFJAEEU.mjs → chunk-LDJD5ITW.mjs} +1 -0
  37. package/dist/{chunk-QYWOI3DO.mjs → chunk-MHSSZ6XE.mjs} +204 -144
  38. package/dist/{chunk-BTDR3VAG.mjs → chunk-Q3HJI7ZE.mjs} +4 -21
  39. package/dist/{chunk-MDHDHEPZ.mjs → chunk-TMUQCNLO.mjs} +3 -11
  40. package/dist/{chunk-PXGL7ZXQ.mjs → chunk-V4SUYEVH.mjs} +1 -0
  41. package/dist/codeBlock/index.js.map +1 -1
  42. package/dist/codeBlock/index.mjs.map +1 -1
  43. package/dist/colorPicker/index.d.mts +1 -1
  44. package/dist/colorPicker/index.d.ts +1 -1
  45. package/dist/colorPicker/index.js +35 -31
  46. package/dist/colorPicker/index.js.map +1 -1
  47. package/dist/colorPicker/index.mjs +33 -29
  48. package/dist/colorPicker/index.mjs.map +1 -1
  49. package/dist/combobox/index.d.mts +2 -2
  50. package/dist/combobox/index.d.ts +2 -2
  51. package/dist/combobox/index.js +52 -48
  52. package/dist/combobox/index.js.map +1 -1
  53. package/dist/combobox/index.mjs +52 -48
  54. package/dist/combobox/index.mjs.map +1 -1
  55. package/dist/command/index.d.mts +1 -1
  56. package/dist/command/index.d.ts +1 -1
  57. package/dist/command/index.js +26 -4
  58. package/dist/command/index.js.map +1 -1
  59. package/dist/command/index.mjs +26 -4
  60. package/dist/command/index.mjs.map +1 -1
  61. package/dist/dataTable/index.js +1 -10
  62. package/dist/dataTable/index.js.map +1 -1
  63. package/dist/dataTable/index.mjs +1 -10
  64. package/dist/dataTable/index.mjs.map +1 -1
  65. package/dist/datePicker/index.js.map +1 -1
  66. package/dist/datePicker/index.mjs.map +1 -1
  67. package/dist/docsLayout/index.js.map +1 -1
  68. package/dist/docsLayout/index.mjs.map +1 -1
  69. package/dist/elements/index.d.mts +48 -25
  70. package/dist/elements/index.d.ts +48 -25
  71. package/dist/elements/index.js +361 -294
  72. package/dist/elements/index.mjs +40 -27
  73. package/dist/fileDropzone/index.js.map +1 -1
  74. package/dist/fileDropzone/index.mjs.map +1 -1
  75. package/dist/{index-e_Ob_SnB.d.ts → index-B0aJcA6d.d.mts} +6 -4
  76. package/dist/{index-e_Ob_SnB.d.mts → index-B0aJcA6d.d.ts} +6 -4
  77. package/dist/index.css +29 -3
  78. package/dist/index.d.mts +50 -26
  79. package/dist/index.d.ts +50 -26
  80. package/dist/index.js +790 -721
  81. package/dist/index.mjs +313 -248
  82. package/dist/input/index.d.mts +1 -1
  83. package/dist/input/index.d.ts +1 -1
  84. package/dist/input/index.js +46 -42
  85. package/dist/input/index.js.map +1 -1
  86. package/dist/input/index.mjs +45 -41
  87. package/dist/input/index.mjs.map +1 -1
  88. package/dist/interfaceSettings/index.js +64 -69
  89. package/dist/interfaceSettings/index.js.map +1 -1
  90. package/dist/interfaceSettings/index.mjs +57 -62
  91. package/dist/interfaceSettings/index.mjs.map +1 -1
  92. package/dist/layout/index.d.mts +1 -1
  93. package/dist/layout/index.d.ts +1 -1
  94. package/dist/layout/index.mjs +2 -2
  95. package/dist/passwordInput/index.js +70 -66
  96. package/dist/passwordInput/index.js.map +1 -1
  97. package/dist/passwordInput/index.mjs +59 -55
  98. package/dist/passwordInput/index.mjs.map +1 -1
  99. package/dist/phoneInput/index.js +50 -55
  100. package/dist/phoneInput/index.js.map +1 -1
  101. package/dist/phoneInput/index.mjs +47 -52
  102. package/dist/phoneInput/index.mjs.map +1 -1
  103. package/dist/pinInput/index.d.mts +37 -16
  104. package/dist/pinInput/index.d.ts +37 -16
  105. package/dist/pinInput/index.js +208 -78
  106. package/dist/pinInput/index.js.map +1 -1
  107. package/dist/pinInput/index.mjs +203 -77
  108. package/dist/pinInput/index.mjs.map +1 -1
  109. package/dist/radio/index.d.mts +1 -1
  110. package/dist/radio/index.d.ts +1 -1
  111. package/dist/radio/index.js +55 -60
  112. package/dist/radio/index.js.map +1 -1
  113. package/dist/radio/index.mjs +50 -55
  114. package/dist/radio/index.mjs.map +1 -1
  115. package/dist/scrollArea/index.js +2 -2
  116. package/dist/scrollArea/index.js.map +1 -1
  117. package/dist/scrollArea/index.mjs +2 -2
  118. package/dist/scrollArea/index.mjs.map +1 -1
  119. package/dist/select/index.d.mts +1 -1
  120. package/dist/select/index.d.ts +1 -1
  121. package/dist/select/index.js +43 -39
  122. package/dist/select/index.js.map +1 -1
  123. package/dist/select/index.mjs +43 -39
  124. package/dist/select/index.mjs.map +1 -1
  125. package/dist/signature/index.d.mts +1 -1
  126. package/dist/signature/index.d.ts +1 -1
  127. package/dist/signature/index.js.map +1 -1
  128. package/dist/signature/index.mjs.map +1 -1
  129. package/dist/sortButton/index.js.map +1 -1
  130. package/dist/sortButton/index.mjs.map +1 -1
  131. package/dist/splitButton/index.js.map +1 -1
  132. package/dist/splitButton/index.mjs.map +1 -1
  133. package/dist/stats/index.d.mts +1 -1
  134. package/dist/stats/index.d.ts +1 -1
  135. package/dist/stats/index.js.map +1 -1
  136. package/dist/stats/index.mjs.map +1 -1
  137. package/dist/tabs/index.js +2 -2
  138. package/dist/tabs/index.js.map +1 -1
  139. package/dist/tabs/index.mjs +2 -2
  140. package/dist/tabs/index.mjs.map +1 -1
  141. package/dist/textarea/index.d.mts +1 -1
  142. package/dist/textarea/index.d.ts +1 -1
  143. package/dist/textarea/index.js +34 -30
  144. package/dist/textarea/index.js.map +1 -1
  145. package/dist/textarea/index.mjs +34 -30
  146. package/dist/textarea/index.mjs.map +1 -1
  147. package/package.json +3 -2
@@ -48,7 +48,7 @@ declare const Input: React__default.ForwardRefExoticComponent<React__default.Inp
48
48
  isLoadingError?: boolean | undefined;
49
49
  containerClassName?: string | undefined;
50
50
  margin?: "none" | "large" | "normal" | undefined;
51
- width?: "full" | "small" | "auto" | "normal" | undefined;
51
+ width?: "small" | "full" | "auto" | "normal" | undefined;
52
52
  /** The label of the input field */
53
53
  label?: any;
54
54
  labelProps?: LabelProps | undefined;
@@ -48,7 +48,7 @@ declare const Input: React__default.ForwardRefExoticComponent<React__default.Inp
48
48
  isLoadingError?: boolean | undefined;
49
49
  containerClassName?: string | undefined;
50
50
  margin?: "none" | "large" | "normal" | undefined;
51
- width?: "full" | "small" | "auto" | "normal" | undefined;
51
+ width?: "small" | "full" | "auto" | "normal" | undefined;
52
52
  /** The label of the input field */
53
53
  label?: any;
54
54
  labelProps?: LabelProps | undefined;
@@ -36,7 +36,7 @@ __export(input_exports, {
36
36
  module.exports = __toCommonJS(input_exports);
37
37
 
38
38
  // elements/input/Input.tsx
39
- var import_react3 = __toESM(require("react"));
39
+ var import_react4 = __toESM(require("react"));
40
40
 
41
41
  // util/index.ts
42
42
  var import_clsx = require("clsx");
@@ -45,13 +45,26 @@ function cn(...inputs) {
45
45
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
46
46
  }
47
47
 
48
+ // elements/helperText/HelperText.tsx
49
+ var import_react = __toESM(require("react"));
50
+ var HelperText = ({ helperText }) => /* @__PURE__ */ import_react.default.createElement(
51
+ "p",
52
+ {
53
+ className: cn(
54
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
55
+ helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
56
+ )
57
+ },
58
+ helperText
59
+ );
60
+
48
61
  // elements/label/Label.tsx
49
- var React2 = __toESM(require("react"));
62
+ var React3 = __toESM(require("react"));
50
63
 
51
64
  // elements/tooltip/Tooltip.tsx
52
- var import_react = __toESM(require("react"));
65
+ var import_react2 = __toESM(require("react"));
53
66
  var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
54
- var TooltipContent = import_react.default.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ import_react.default.createElement(
67
+ var TooltipContent = import_react2.default.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ import_react2.default.createElement(
55
68
  TooltipPrimitive.Content,
56
69
  {
57
70
  ref,
@@ -68,7 +81,7 @@ var TooltipContent = import_react.default.forwardRef(({ className, sideOffset =
68
81
  }
69
82
  ));
70
83
  TooltipContent.displayName = TooltipPrimitive.Content.displayName;
71
- var TooltipArrow = import_react.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react.default.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
84
+ var TooltipArrow = import_react2.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
72
85
  TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
73
86
  var Tooltip = ({
74
87
  side,
@@ -85,13 +98,13 @@ var Tooltip = ({
85
98
  delayDuration = 300,
86
99
  ...props
87
100
  }) => {
88
- return /* @__PURE__ */ import_react.default.createElement(
101
+ return /* @__PURE__ */ import_react2.default.createElement(
89
102
  TooltipPrimitive.TooltipProvider,
90
103
  {
91
104
  delayDuration,
92
105
  ...providerProps
93
106
  },
94
- /* @__PURE__ */ import_react.default.createElement(
107
+ /* @__PURE__ */ import_react2.default.createElement(
95
108
  TooltipPrimitive.Root,
96
109
  {
97
110
  open: !disabled && open,
@@ -99,8 +112,8 @@ var Tooltip = ({
99
112
  onOpenChange,
100
113
  ...props
101
114
  },
102
- /* @__PURE__ */ import_react.default.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
103
- /* @__PURE__ */ import_react.default.createElement(
115
+ /* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
116
+ /* @__PURE__ */ import_react2.default.createElement(
104
117
  TooltipContent,
105
118
  {
106
119
  size,
@@ -120,7 +133,7 @@ var Tooltip = ({
120
133
  };
121
134
 
122
135
  // elements/label/Label.tsx
123
- var Label = React2.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React2.createElement(
136
+ var Label = React3.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React3.createElement(
124
137
  "label",
125
138
  {
126
139
  ref,
@@ -131,8 +144,8 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
131
144
  ...props
132
145
  },
133
146
  children,
134
- required && /* @__PURE__ */ React2.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
135
- ), hint && /* @__PURE__ */ React2.createElement(
147
+ required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
148
+ ), hint && /* @__PURE__ */ React3.createElement(
136
149
  Tooltip,
137
150
  {
138
151
  content: hint,
@@ -142,7 +155,7 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
142
155
  onClick: (event) => event.preventDefault()
143
156
  }
144
157
  },
145
- /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
158
+ /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
146
159
  "svg",
147
160
  {
148
161
  xmlns: "http://www.w3.org/2000/svg",
@@ -154,15 +167,15 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
154
167
  strokeLinecap: "round",
155
168
  strokeLinejoin: "round"
156
169
  },
157
- /* @__PURE__ */ React2.createElement("circle", { cx: "12", cy: "12", r: "10" }),
158
- /* @__PURE__ */ React2.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
159
- /* @__PURE__ */ React2.createElement("path", { d: "M12 17h.01" })
170
+ /* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
171
+ /* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
172
+ /* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
160
173
  ))
161
174
  )));
162
175
  Label.displayName = "Label";
163
176
 
164
177
  // elements/skeleton/Skeleton.tsx
165
- var import_react2 = __toESM(require("react"));
178
+ var import_react3 = __toESM(require("react"));
166
179
  function Skeleton({
167
180
  className,
168
181
  content,
@@ -181,7 +194,7 @@ function Skeleton({
181
194
  right: "hawa-mask-fade-right",
182
195
  left: "hawa-mask-fade-left "
183
196
  };
184
- return /* @__PURE__ */ import_react2.default.createElement(
197
+ return /* @__PURE__ */ import_react3.default.createElement(
185
198
  "div",
186
199
  {
187
200
  className: cn(
@@ -197,7 +210,7 @@ function Skeleton({
197
210
  }
198
211
 
199
212
  // elements/input/Input.tsx
200
- var Input = (0, import_react3.forwardRef)(
213
+ var Input = (0, import_react4.forwardRef)(
201
214
  ({
202
215
  margin = "none",
203
216
  width = "full",
@@ -241,7 +254,7 @@ var Input = (0, import_react3.forwardRef)(
241
254
  props.onChange(newEvent);
242
255
  }
243
256
  };
244
- return /* @__PURE__ */ import_react3.default.createElement(
257
+ return /* @__PURE__ */ import_react4.default.createElement(
245
258
  "div",
246
259
  {
247
260
  className: cn(
@@ -252,8 +265,8 @@ var Input = (0, import_react3.forwardRef)(
252
265
  "hawa-w-full hawa-gap-2"
253
266
  )
254
267
  },
255
- props.label && /* @__PURE__ */ import_react3.default.createElement(Label, { ...labelProps }, props.label),
256
- /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ import_react3.default.createElement(
268
+ props.label && /* @__PURE__ */ import_react4.default.createElement(Label, { ...labelProps }, props.label),
269
+ /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ import_react4.default.createElement(
257
270
  "span",
258
271
  {
259
272
  className: cn(
@@ -262,12 +275,12 @@ var Input = (0, import_react3.forwardRef)(
262
275
  )
263
276
  },
264
277
  props.outsidePrefix
265
- ), props.isLoading ? /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react3.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react3.default.createElement(
278
+ ), props.isLoading ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react4.default.createElement(
266
279
  Skeleton,
267
280
  {
268
281
  animation: "none",
269
282
  className: "hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]",
270
- content: /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ import_react3.default.createElement(
283
+ content: /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ import_react4.default.createElement(
271
284
  "svg",
272
285
  {
273
286
  xmlns: "http://www.w3.org/2000/svg",
@@ -281,12 +294,12 @@ var Input = (0, import_react3.forwardRef)(
281
294
  strokeLinejoin: "round",
282
295
  className: "hawa-text-destructive"
283
296
  },
284
- /* @__PURE__ */ import_react3.default.createElement("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
285
- /* @__PURE__ */ import_react3.default.createElement("path", { d: "M12 9v4" }),
286
- /* @__PURE__ */ import_react3.default.createElement("path", { d: "M12 17h.01" })
287
- ), /* @__PURE__ */ import_react3.default.createElement("span", null, /* @__PURE__ */ import_react3.default.createElement("span", { className: "hawa-text-destructive" }, props.loadingErrorMesssage || "Error loading data")))
297
+ /* @__PURE__ */ import_react4.default.createElement("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
298
+ /* @__PURE__ */ import_react4.default.createElement("path", { d: "M12 9v4" }),
299
+ /* @__PURE__ */ import_react4.default.createElement("path", { d: "M12 17h.01" })
300
+ ), /* @__PURE__ */ import_react4.default.createElement("span", null, /* @__PURE__ */ import_react4.default.createElement("span", { className: "hawa-text-destructive" }, props.loadingErrorMesssage || "Error loading data")))
288
301
  }
289
- )) : /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, !props.hideSeparator && /* @__PURE__ */ import_react3.default.createElement(
302
+ )) : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, !props.hideSeparator && /* @__PURE__ */ import_react4.default.createElement(
290
303
  "div",
291
304
  {
292
305
  className: cn(
@@ -294,7 +307,7 @@ var Input = (0, import_react3.forwardRef)(
294
307
  preview ? "hawa-opacity-100" : "hawa-opacity-0"
295
308
  )
296
309
  }
297
- ), /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-relative" }, props.startIcon && /* @__PURE__ */ import_react3.default.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ import_react3.default.createElement(
310
+ ), /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-relative" }, props.startIcon && /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ import_react4.default.createElement(
298
311
  "div",
299
312
  {
300
313
  className: cn(
@@ -303,7 +316,7 @@ var Input = (0, import_react3.forwardRef)(
303
316
  )
304
317
  },
305
318
  props.endIcon
306
- ), /* @__PURE__ */ import_react3.default.createElement(
319
+ ), /* @__PURE__ */ import_react4.default.createElement(
307
320
  "input",
308
321
  {
309
322
  required: true,
@@ -329,16 +342,7 @@ var Input = (0, import_react3.forwardRef)(
329
342
  inputProps == null ? void 0 : inputProps.className
330
343
  )
331
344
  }
332
- )), !forceHideHelperText && /* @__PURE__ */ import_react3.default.createElement(
333
- "p",
334
- {
335
- className: cn(
336
- "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
337
- props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
338
- )
339
- },
340
- props.helperText
341
- ), !props.disabled && forceHideHelperText && /* @__PURE__ */ import_react3.default.createElement(
345
+ )), !forceHideHelperText && /* @__PURE__ */ import_react4.default.createElement(HelperText, { helperText: props.helperText }), !props.disabled && forceHideHelperText && /* @__PURE__ */ import_react4.default.createElement(
342
346
  "div",
343
347
  {
344
348
  className: cn(
@@ -347,7 +351,7 @@ var Input = (0, import_react3.forwardRef)(
347
351
  )
348
352
  },
349
353
  props.helperText
350
- ), showCount && /* @__PURE__ */ import_react3.default.createElement(
354
+ ), showCount && /* @__PURE__ */ import_react4.default.createElement(
351
355
  "div",
352
356
  {
353
357
  className: cn(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/input/index.ts","../../elements/input/Input.tsx","../../util/index.ts","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Input\";\n","import React, { forwardRef } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { Label, LabelProps } from \"../label/Label\";\nimport { Skeleton } from \"../skeleton/Skeleton\";\n\nexport type TextFieldTypes = React.InputHTMLAttributes<HTMLInputElement> & {\n isLoading?: boolean;\n isLoadingError?: boolean;\n containerClassName?: string;\n margin?: \"none\" | \"normal\" | \"large\";\n width?: \"small\" | \"normal\" | \"full\" | \"auto\";\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n hideSeparator?: boolean;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n prefixText?: any;\n forceHideHelperText?: boolean;\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** The icon inside the input field */\n icon?: any;\n /** Boolean to enable/disable editing the input field and using it as a text field */\n preview?: boolean;\n // maxLength?: any;\n iconInside?: React.ReactNode;\n endIcon?: React.ReactNode;\n endIconProps?: { className?: string };\n startIcon?: React.ReactNode;\n placeholder?: React.ReactNode;\n /** Show the count of characters left in the input field. Works along with maxLength prop. */\n showCount?: boolean;\n countPosition?: \"top\" | \"bottom\" | \"center\";\n popup?: boolean;\n popupContent?: React.ReactNode;\n outsidePrefix?: any;\n loadingErrorMesssage?: string;\n};\nexport const Input = forwardRef<HTMLInputElement, TextFieldTypes>(\n (\n {\n margin = \"none\",\n width = \"full\",\n preview = false,\n forceHideHelperText = false,\n labelProps,\n placeholder,\n showCount,\n inputProps,\n countPosition = \"bottom\",\n ...props\n },\n ref,\n ) => {\n let marginStyles = {\n none: \"hawa-mb-0\",\n normal: \"hawa-mb-3\",\n large: \"hawa-mb-5\",\n };\n let widthStyles = {\n small: \"hawa-w-full hawa-max-w-2xs\",\n normal: \"hawa-w-1/2\",\n full: \"hawa-w-full\",\n auto: \"\",\n };\n\n let defaultStyle =\n \"hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0\";\n let defaultInputStyle =\n \"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground\";\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let newValue = e.target.value;\n\n if (props.prefixText) {\n // If newValue is shorter than prefixText, set newValue to prefixText\n if (newValue.length < props.prefixText.length) {\n newValue = props.prefixText;\n } else {\n // Check if newValue starts with a substring of prefixText\n const isSubstring = props.prefixText.startsWith(newValue);\n\n if (!isSubstring && !newValue.startsWith(props.prefixText)) {\n newValue = `${props.prefixText}${newValue}`;\n }\n }\n }\n\n if (props.onChange) {\n const newEvent = { ...e, target: { ...e.target, value: newValue } };\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n }\n };\n\n return (\n <div\n className={cn(\n defaultStyle,\n marginStyles[margin],\n widthStyles[width],\n props.containerClassName,\n \"hawa-w-full hawa-gap-2\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className=\"hawa-flex hawa-flex-row hawa-w-full hawa-items-center \">\n {props.outsidePrefix && (\n <span\n className={cn(\n \"hawa-me-2 hawa-opacity-90\",\n !forceHideHelperText && \"hawa-mb-2\",\n )}\n >\n {props.outsidePrefix}\n </span>\n )}\n {props.isLoading ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n </div>\n ) : props.isLoadingError ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton\n animation=\"none\"\n className=\"hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]\"\n content={\n <div className=\"hawa-flex hawa-flex-row hawa-gap-2\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-text-destructive\"\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n <span>\n <span className=\"hawa-text-destructive\">\n {props.loadingErrorMesssage || \"Error loading data\"}\n </span>\n </span>\n </div>\n }\n />\n </div>\n ) : (\n <>\n {!props.hideSeparator && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800\",\n preview ? \"hawa-opacity-100\" : \"hawa-opacity-0\",\n )}\n ></div>\n )}\n <div className=\"hawa-flex hawa-flex-col hawa-w-full hawa-gap-2\">\n <div className={\"hawa-relative\"}>\n {props.startIcon && (\n <div className=\"hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2\">\n {props.startIcon}\n </div>\n )}\n {props.endIcon && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2\",\n props.endIconProps?.className,\n )}\n >\n {props.endIcon}\n </div>\n )}\n <input\n required\n dir={props.dir}\n type={props.type}\n value={props.value}\n onChange={handleChange}\n autoComplete={props.autoComplete}\n defaultValue={props.defaultValue}\n placeholder={placeholder}\n disabled={props.disabled || preview}\n style={{ height: 40 }}\n {...inputProps}\n className={cn(\n defaultInputStyle,\n \" focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white\",\n {\n \"hawa-pe-9\": props.endIcon,\n \"hawa-ps-9\": props.startIcon,\n \"hawa-pe-[60px]\": countPosition === \"center\",\n },\n preview &&\n \"hawa-border-transparent hawa-bg-transparent hawa-px-0\",\n inputProps?.className,\n )}\n />\n </div>\n\n {/* Regular helper text */}\n {!forceHideHelperText && (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n props.helperText\n ? \"hawa-h-4 hawa-opacity-100\"\n : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {props.helperText}\n </p>\n )}\n {/* Popover helper text */}\n {!props.disabled && forceHideHelperText && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all\",\n props.helperText\n ? \"hawa-border hawa-p-1\"\n : \"hawa-border-none hawa-p-0\",\n )}\n >\n {props.helperText}\n </div>\n )}\n {/* Character Counter */}\n {showCount && (\n <div\n className={cn(\n \"hawa-absolute hawa-translate-y-1/2 hawa-text-start hawa-text-xs hawa-transition-all\",\n {\n \"hawa-end-0 hawa-top-[62px]\":\n countPosition === \"bottom\",\n \"hawa-bottom-[62px] hawa-end-0\":\n countPosition === \"top\",\n \"hawa-end-2\": countPosition === \"center\",\n },\n )}\n >\n {props.value ? String(props.value).length : 0}/\n {props.maxLength}\n </div>\n )}\n\n {/* Popover helper text */}\n {/* {props.popup && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[47px] hawa-min-h-fit hawa-w-full hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start hawa-rounded hawa-end-0 hawa-z-20 hawa-drop-shadow-md hawa-bg-background hawa-translate-y-1/2\",\n props.helperText\n ? \"hawa-border hawa-p-1\"\n : \"hawa-border-none hawa-p-0\"\n )}\n >\n {props.popupContent}\n </div>\n )} */}\n </div>\n </>\n )}\n </div>\n </div>\n );\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault()\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\"\n },\n className\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\"\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React 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}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\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 return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\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,gBAAkC;;;ACAlC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,IAAAC,SAAuB;;;ACAvB,mBAAkB;AAElB,uBAAk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ACE,kBAAkB;AAAA,cACpB,iCACE,kBAAkB;AAAA,cACpB,cAAc,kBAAkB;AAAA,YAClC;AAAA,UACF;AAAA;AAAA,QAEC,MAAM,QAAQ,OAAO,MAAM,KAAK,EAAE,SAAS;AAAA,QAAE;AAAA,QAC7C,MAAM;AAAA,MACT,CAgBJ,CACF,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;","names":["import_react","React","React","import_react","React","React"]}
1
+ {"version":3,"sources":["../../elements/input/index.ts","../../elements/input/Input.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Input\";\n","import React, { forwardRef } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { Skeleton } from \"../skeleton/Skeleton\";\n\nexport type TextFieldTypes = React.InputHTMLAttributes<HTMLInputElement> & {\n isLoading?: boolean;\n isLoadingError?: boolean;\n containerClassName?: string;\n margin?: \"none\" | \"normal\" | \"large\";\n width?: \"small\" | \"normal\" | \"full\" | \"auto\";\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n hideSeparator?: boolean;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n prefixText?: any;\n forceHideHelperText?: boolean;\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** The icon inside the input field */\n icon?: any;\n /** Boolean to enable/disable editing the input field and using it as a text field */\n preview?: boolean;\n // maxLength?: any;\n iconInside?: React.ReactNode;\n endIcon?: React.ReactNode;\n endIconProps?: { className?: string };\n startIcon?: React.ReactNode;\n placeholder?: React.ReactNode;\n /** Show the count of characters left in the input field. Works along with maxLength prop. */\n showCount?: boolean;\n countPosition?: \"top\" | \"bottom\" | \"center\";\n popup?: boolean;\n popupContent?: React.ReactNode;\n outsidePrefix?: any;\n loadingErrorMesssage?: string;\n};\nexport const Input = forwardRef<HTMLInputElement, TextFieldTypes>(\n (\n {\n margin = \"none\",\n width = \"full\",\n preview = false,\n forceHideHelperText = false,\n labelProps,\n placeholder,\n showCount,\n inputProps,\n countPosition = \"bottom\",\n ...props\n },\n ref,\n ) => {\n let marginStyles = {\n none: \"hawa-mb-0\",\n normal: \"hawa-mb-3\",\n large: \"hawa-mb-5\",\n };\n let widthStyles = {\n small: \"hawa-w-full hawa-max-w-2xs\",\n normal: \"hawa-w-1/2\",\n full: \"hawa-w-full\",\n auto: \"\",\n };\n\n let defaultStyle =\n \"hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0\";\n let defaultInputStyle =\n \"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground\";\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let newValue = e.target.value;\n\n if (props.prefixText) {\n // If newValue is shorter than prefixText, set newValue to prefixText\n if (newValue.length < props.prefixText.length) {\n newValue = props.prefixText;\n } else {\n // Check if newValue starts with a substring of prefixText\n const isSubstring = props.prefixText.startsWith(newValue);\n\n if (!isSubstring && !newValue.startsWith(props.prefixText)) {\n newValue = `${props.prefixText}${newValue}`;\n }\n }\n }\n\n if (props.onChange) {\n const newEvent = { ...e, target: { ...e.target, value: newValue } };\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n }\n };\n\n return (\n <div\n className={cn(\n defaultStyle,\n marginStyles[margin],\n widthStyles[width],\n props.containerClassName,\n \"hawa-w-full hawa-gap-2\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className=\"hawa-flex hawa-flex-row hawa-w-full hawa-items-center \">\n {props.outsidePrefix && (\n <span\n className={cn(\n \"hawa-me-2 hawa-opacity-90\",\n !forceHideHelperText && \"hawa-mb-2\",\n )}\n >\n {props.outsidePrefix}\n </span>\n )}\n {props.isLoading ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n </div>\n ) : props.isLoadingError ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton\n animation=\"none\"\n className=\"hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]\"\n content={\n <div className=\"hawa-flex hawa-flex-row hawa-gap-2\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-text-destructive\"\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n <span>\n <span className=\"hawa-text-destructive\">\n {props.loadingErrorMesssage || \"Error loading data\"}\n </span>\n </span>\n </div>\n }\n />\n </div>\n ) : (\n <>\n {!props.hideSeparator && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800\",\n preview ? \"hawa-opacity-100\" : \"hawa-opacity-0\",\n )}\n ></div>\n )}\n <div className=\"hawa-flex hawa-flex-col hawa-w-full hawa-gap-2\">\n <div className={\"hawa-relative\"}>\n {props.startIcon && (\n <div className=\"hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2\">\n {props.startIcon}\n </div>\n )}\n {props.endIcon && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2\",\n props.endIconProps?.className,\n )}\n >\n {props.endIcon}\n </div>\n )}\n <input\n required\n dir={props.dir}\n type={props.type}\n value={props.value}\n onChange={handleChange}\n autoComplete={props.autoComplete}\n defaultValue={props.defaultValue}\n placeholder={placeholder}\n disabled={props.disabled || preview}\n style={{ height: 40 }}\n {...inputProps}\n className={cn(\n defaultInputStyle,\n \" focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white\",\n {\n \"hawa-pe-9\": props.endIcon,\n \"hawa-ps-9\": props.startIcon,\n \"hawa-pe-[60px]\": countPosition === \"center\",\n },\n preview &&\n \"hawa-border-transparent hawa-bg-transparent hawa-px-0\",\n inputProps?.className,\n )}\n />\n </div>\n\n {/* Regular helper text */}\n {!forceHideHelperText && (\n <HelperText helperText={props.helperText} />\n )}\n {/* Popover helper text */}\n {!props.disabled && forceHideHelperText && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all\",\n props.helperText\n ? \"hawa-border hawa-p-1\"\n : \"hawa-border-none hawa-p-0\",\n )}\n >\n {props.helperText}\n </div>\n )}\n {/* Character Counter */}\n {showCount && (\n <div\n className={cn(\n \"hawa-absolute hawa-translate-y-1/2 hawa-text-start hawa-text-xs hawa-transition-all\",\n {\n \"hawa-end-0 hawa-top-[62px]\":\n countPosition === \"bottom\",\n \"hawa-bottom-[62px] hawa-end-0\":\n countPosition === \"top\",\n \"hawa-end-2\": countPosition === \"center\",\n },\n )}\n >\n {props.value ? String(props.value).length : 0}/\n {props.maxLength}\n </div>\n )}\n\n {/* Popover helper text */}\n {/* {props.popup && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[47px] hawa-min-h-fit hawa-w-full hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start hawa-rounded hawa-end-0 hawa-z-20 hawa-drop-shadow-md hawa-bg-background hawa-translate-y-1/2\",\n props.helperText\n ? \"hawa-border hawa-p-1\"\n : \"hawa-border-none hawa-p-0\"\n )}\n >\n {props.popupContent}\n </div>\n )} */}\n </div>\n </>\n )}\n </div>\n </div>\n );\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 = ({ helperText }: { helperText?: any }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n helperText ? \"hawa-h-4 hawa-opacity-100\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault()\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\"\n },\n className\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProviderProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\"\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React 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}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\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 return (\n <div\n className={cn(\n animationStyles[animation],\n content &&\n \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\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,gBAAkC;;;ACAlC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,mBAAkB;AAIX,IAAM,aAAa,CAAC,EAAE,WAAW,MACtC,6BAAAC,QAAA;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;ACZF,IAAAC,SAAuB;;;ACAvB,IAAAC,gBAAkB;AAElB,uBAAkC;AAKlC,IAAM,iBAAiB,cAAAC,QAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,8BAAAA,QAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,gBAAgB,SAAS;AAAA,QACzB,gBAAgB,SAAS;AAAA,MAC3B;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,e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AAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,UAAQ;AAAA,UACR,KAAK,MAAM;AAAA,UACX,MAAM,MAAM;AAAA,UACZ,OAAO,MAAM;AAAA,UACb,UAAU;AAAA,UACV,cAAc,MAAM;AAAA,UACpB,cAAc,MAAM;AAAA,UACpB;AAAA,UACA,UAAU,MAAM,YAAY;AAAA,UAC5B,OAAO,EAAE,QAAQ,GAAG;AAAA,UACnB,GAAG;AAAA,UACJ,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,cACE,aAAa,MAAM;AAAA,cACnB,aAAa,MAAM;AAAA,cACnB,kBAAkB,kBAAkB;AAAA,YACtC;AAAA,YACA,WACE;AAAA,YACF,yCAAY;AAAA,UACd;AAAA;AAAA,MACF,CACF,GAGC,CAAC,uBACA,8BAAAA,QAAA,cAAC,cAAW,YAAY,MAAM,YAAY,GAG3C,CAAC,MAAM,YAAY,uBAClB,8BAAAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,MAAM,aACF,yBACA;AAAA,UACN;AAAA;AAAA,QAEC,MAAM;AAAA,MACT,GAGD,aACC,8BAAAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,cACE,8BACE,kBAAkB;AAAA,cACpB,iCACE,kBAAkB;AAAA,cACpB,cAAc,kBAAkB;AAAA,YAClC;AAAA,UACF;AAAA;AAAA,QAEC,MAAM,QAAQ,OAAO,MAAM,KAAK,EAAE,SAAS;AAAA,QAAE;AAAA,QAC7C,MAAM;AAAA,MACT,CAgBJ,CACF,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;","names":["import_react","React","React","import_react","React","import_react","React","React"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  // elements/input/Input.tsx
4
- import React4, { forwardRef as forwardRef2 } from "react";
4
+ import React5, { forwardRef as forwardRef2 } from "react";
5
5
 
6
6
  // util/index.ts
7
7
  import { clsx } from "clsx";
@@ -10,13 +10,26 @@ function cn(...inputs) {
10
10
  return twMerge(clsx(inputs));
11
11
  }
12
12
 
13
+ // elements/helperText/HelperText.tsx
14
+ import React from "react";
15
+ var HelperText = ({ helperText }) => /* @__PURE__ */ React.createElement(
16
+ "p",
17
+ {
18
+ className: cn(
19
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
20
+ helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
21
+ )
22
+ },
23
+ helperText
24
+ );
25
+
13
26
  // elements/label/Label.tsx
14
- import * as React2 from "react";
27
+ import * as React3 from "react";
15
28
 
16
29
  // elements/tooltip/Tooltip.tsx
17
- import React from "react";
30
+ import React2 from "react";
18
31
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
19
- var TooltipContent = React.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ React.createElement(
32
+ var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ React2.createElement(
20
33
  TooltipPrimitive.Content,
21
34
  {
22
35
  ref,
@@ -33,7 +46,7 @@ var TooltipContent = React.forwardRef(({ className, sideOffset = 4, size = "defa
33
46
  }
34
47
  ));
35
48
  TooltipContent.displayName = TooltipPrimitive.Content.displayName;
36
- var TooltipArrow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
49
+ var TooltipArrow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
37
50
  TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
38
51
  var Tooltip = ({
39
52
  side,
@@ -50,13 +63,13 @@ var Tooltip = ({
50
63
  delayDuration = 300,
51
64
  ...props
52
65
  }) => {
53
- return /* @__PURE__ */ React.createElement(
66
+ return /* @__PURE__ */ React2.createElement(
54
67
  TooltipPrimitive.TooltipProvider,
55
68
  {
56
69
  delayDuration,
57
70
  ...providerProps
58
71
  },
59
- /* @__PURE__ */ React.createElement(
72
+ /* @__PURE__ */ React2.createElement(
60
73
  TooltipPrimitive.Root,
61
74
  {
62
75
  open: !disabled && open,
@@ -64,8 +77,8 @@ var Tooltip = ({
64
77
  onOpenChange,
65
78
  ...props
66
79
  },
67
- /* @__PURE__ */ React.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
68
- /* @__PURE__ */ React.createElement(
80
+ /* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
81
+ /* @__PURE__ */ React2.createElement(
69
82
  TooltipContent,
70
83
  {
71
84
  size,
@@ -85,7 +98,7 @@ var Tooltip = ({
85
98
  };
86
99
 
87
100
  // elements/label/Label.tsx
88
- var Label = React2.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React2.createElement(
101
+ var Label = React3.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React3.createElement(
89
102
  "label",
90
103
  {
91
104
  ref,
@@ -96,8 +109,8 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
96
109
  ...props
97
110
  },
98
111
  children,
99
- required && /* @__PURE__ */ React2.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
100
- ), hint && /* @__PURE__ */ React2.createElement(
112
+ required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
113
+ ), hint && /* @__PURE__ */ React3.createElement(
101
114
  Tooltip,
102
115
  {
103
116
  content: hint,
@@ -107,7 +120,7 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
107
120
  onClick: (event) => event.preventDefault()
108
121
  }
109
122
  },
110
- /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
123
+ /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
111
124
  "svg",
112
125
  {
113
126
  xmlns: "http://www.w3.org/2000/svg",
@@ -119,15 +132,15 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
119
132
  strokeLinecap: "round",
120
133
  strokeLinejoin: "round"
121
134
  },
122
- /* @__PURE__ */ React2.createElement("circle", { cx: "12", cy: "12", r: "10" }),
123
- /* @__PURE__ */ React2.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
124
- /* @__PURE__ */ React2.createElement("path", { d: "M12 17h.01" })
135
+ /* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
136
+ /* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
137
+ /* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
125
138
  ))
126
139
  )));
127
140
  Label.displayName = "Label";
128
141
 
129
142
  // elements/skeleton/Skeleton.tsx
130
- import React3 from "react";
143
+ import React4 from "react";
131
144
  function Skeleton({
132
145
  className,
133
146
  content,
@@ -146,7 +159,7 @@ function Skeleton({
146
159
  right: "hawa-mask-fade-right",
147
160
  left: "hawa-mask-fade-left "
148
161
  };
149
- return /* @__PURE__ */ React3.createElement(
162
+ return /* @__PURE__ */ React4.createElement(
150
163
  "div",
151
164
  {
152
165
  className: cn(
@@ -206,7 +219,7 @@ var Input = forwardRef2(
206
219
  props.onChange(newEvent);
207
220
  }
208
221
  };
209
- return /* @__PURE__ */ React4.createElement(
222
+ return /* @__PURE__ */ React5.createElement(
210
223
  "div",
211
224
  {
212
225
  className: cn(
@@ -217,8 +230,8 @@ var Input = forwardRef2(
217
230
  "hawa-w-full hawa-gap-2"
218
231
  )
219
232
  },
220
- props.label && /* @__PURE__ */ React4.createElement(Label, { ...labelProps }, props.label),
221
- /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ React4.createElement(
233
+ props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label),
234
+ /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ React5.createElement(
222
235
  "span",
223
236
  {
224
237
  className: cn(
@@ -227,12 +240,12 @@ var Input = forwardRef2(
227
240
  )
228
241
  },
229
242
  props.outsidePrefix
230
- ), props.isLoading ? /* @__PURE__ */ React4.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React4.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ React4.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React4.createElement(
243
+ ), props.isLoading ? /* @__PURE__ */ React5.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React5.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ React5.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React5.createElement(
231
244
  Skeleton,
232
245
  {
233
246
  animation: "none",
234
247
  className: "hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]",
235
- content: /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ React4.createElement(
248
+ content: /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ React5.createElement(
236
249
  "svg",
237
250
  {
238
251
  xmlns: "http://www.w3.org/2000/svg",
@@ -246,12 +259,12 @@ var Input = forwardRef2(
246
259
  strokeLinejoin: "round",
247
260
  className: "hawa-text-destructive"
248
261
  },
249
- /* @__PURE__ */ React4.createElement("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
250
- /* @__PURE__ */ React4.createElement("path", { d: "M12 9v4" }),
251
- /* @__PURE__ */ React4.createElement("path", { d: "M12 17h.01" })
252
- ), /* @__PURE__ */ React4.createElement("span", null, /* @__PURE__ */ React4.createElement("span", { className: "hawa-text-destructive" }, props.loadingErrorMesssage || "Error loading data")))
262
+ /* @__PURE__ */ React5.createElement("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
263
+ /* @__PURE__ */ React5.createElement("path", { d: "M12 9v4" }),
264
+ /* @__PURE__ */ React5.createElement("path", { d: "M12 17h.01" })
265
+ ), /* @__PURE__ */ React5.createElement("span", null, /* @__PURE__ */ React5.createElement("span", { className: "hawa-text-destructive" }, props.loadingErrorMesssage || "Error loading data")))
253
266
  }
254
- )) : /* @__PURE__ */ React4.createElement(React4.Fragment, null, !props.hideSeparator && /* @__PURE__ */ React4.createElement(
267
+ )) : /* @__PURE__ */ React5.createElement(React5.Fragment, null, !props.hideSeparator && /* @__PURE__ */ React5.createElement(
255
268
  "div",
256
269
  {
257
270
  className: cn(
@@ -259,7 +272,7 @@ var Input = forwardRef2(
259
272
  preview ? "hawa-opacity-100" : "hawa-opacity-0"
260
273
  )
261
274
  }
262
- ), /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative" }, props.startIcon && /* @__PURE__ */ React4.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ React4.createElement(
275
+ ), /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, /* @__PURE__ */ React5.createElement("div", { className: "hawa-relative" }, props.startIcon && /* @__PURE__ */ React5.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ React5.createElement(
263
276
  "div",
264
277
  {
265
278
  className: cn(
@@ -268,7 +281,7 @@ var Input = forwardRef2(
268
281
  )
269
282
  },
270
283
  props.endIcon
271
- ), /* @__PURE__ */ React4.createElement(
284
+ ), /* @__PURE__ */ React5.createElement(
272
285
  "input",
273
286
  {
274
287
  required: true,
@@ -294,16 +307,7 @@ var Input = forwardRef2(
294
307
  inputProps == null ? void 0 : inputProps.className
295
308
  )
296
309
  }
297
- )), !forceHideHelperText && /* @__PURE__ */ React4.createElement(
298
- "p",
299
- {
300
- className: cn(
301
- "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
302
- props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
303
- )
304
- },
305
- props.helperText
306
- ), !props.disabled && forceHideHelperText && /* @__PURE__ */ React4.createElement(
310
+ )), !forceHideHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText }), !props.disabled && forceHideHelperText && /* @__PURE__ */ React5.createElement(
307
311
  "div",
308
312
  {
309
313
  className: cn(
@@ -312,7 +316,7 @@ var Input = forwardRef2(
312
316
  )
313
317
  },
314
318
  props.helperText
315
- ), showCount && /* @__PURE__ */ React4.createElement(
319
+ ), showCount && /* @__PURE__ */ React5.createElement(
316
320
  "div",
317
321
  {
318
322
  className: cn(