@sikka/hawa 0.26.21 → 0.26.22

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 (53) hide show
  1. package/README.md +2 -18
  2. package/dist/blocks/auth/index.mjs +5 -4
  3. package/dist/blocks/feedback/index.js +114 -118
  4. package/dist/blocks/feedback/index.mjs +6 -5
  5. package/dist/blocks/index.js +28 -30
  6. package/dist/blocks/index.mjs +2 -2
  7. package/dist/blocks/misc/index.js +28 -30
  8. package/dist/blocks/misc/index.mjs +20 -17
  9. package/dist/blocks/pricing/index.mjs +4 -4
  10. package/dist/{chunk-OTGCLEKC.mjs → chunk-2R7F2GL7.mjs} +20 -0
  11. package/dist/{chunk-POIP5U4M.mjs → chunk-4EGKGSGY.mjs} +1 -1
  12. package/dist/{chunk-APZM24KK.mjs → chunk-5YXZXYLH.mjs} +15 -18
  13. package/dist/{chunk-WPSUV4AD.mjs → chunk-F3DQJHTG.mjs} +29 -31
  14. package/dist/{chunk-VQQ6MUX5.mjs → chunk-FQ6WVEHW.mjs} +1 -1
  15. package/dist/{chunk-U3TZWNDZ.mjs → chunk-GVJYACGA.mjs} +1 -1
  16. package/dist/{chunk-Z5SL5QTQ.mjs → chunk-MQUAGP7K.mjs} +20 -0
  17. package/dist/{chunk-OAXF3RCQ.mjs → chunk-NMS5LCSQ.mjs} +1 -1
  18. package/dist/{chunk-4IOG44R3.mjs → chunk-OY66MBXP.mjs} +1 -1
  19. package/dist/{chunk-FDKCMEMD.mjs → chunk-R4HAAT6R.mjs} +1 -1
  20. package/dist/chunk-WUHNPHD5.mjs +0 -0
  21. package/dist/codeBlock/index.mjs +1 -1
  22. package/dist/colorPicker/index.d.mts +4 -0
  23. package/dist/colorPicker/index.d.ts +4 -0
  24. package/dist/colorPicker/index.js +80 -23
  25. package/dist/colorPicker/index.mjs +54 -15
  26. package/dist/dataTable/index.d.mts +2 -1
  27. package/dist/dataTable/index.d.ts +2 -1
  28. package/dist/dataTable/index.js +1 -1
  29. package/dist/dataTable/index.mjs +1 -1
  30. package/dist/elements/index.d.mts +7 -1
  31. package/dist/elements/index.d.ts +7 -1
  32. package/dist/elements/index.js +62 -34
  33. package/dist/elements/index.mjs +19 -7
  34. package/dist/index.css +11 -3
  35. package/dist/index.d.mts +7 -1
  36. package/dist/index.d.ts +7 -1
  37. package/dist/index.js +62 -34
  38. package/dist/index.mjs +62 -34
  39. package/dist/layout/index.mjs +2 -2
  40. package/dist/switch/index.d.mts +1 -1
  41. package/dist/switch/index.d.ts +1 -1
  42. package/dist/tabs/index.d.mts +2 -2
  43. package/dist/tabs/index.d.ts +2 -2
  44. package/dist/tabs/index.js +15 -13
  45. package/dist/tabs/index.mjs +15 -13
  46. package/dist/textarea/index.d.mts +1 -0
  47. package/dist/textarea/index.d.ts +1 -0
  48. package/dist/textarea/index.js +59 -36
  49. package/dist/textarea/index.mjs +59 -36
  50. package/package.json +1 -1
  51. package/dist/commonTypes-cyhMPvmz.d.mts +0 -4
  52. package/dist/commonTypes-cyhMPvmz.d.ts +0 -4
  53. /package/dist/{chunk-AREFDTXK.mjs → chunk-D36MPDGE.mjs} +0 -0
@@ -131,19 +131,21 @@ var Chip = import_react.default.forwardRef(
131
131
 
132
132
  // elements/tabs/Tabs.tsx
133
133
  var TabsContext = React2.createContext({ orientation: "vertical" });
134
- var Tabs = React2.forwardRef(({ className, orientation, ...props }, ref) => /* @__PURE__ */ React2.createElement(
135
- TabsPrimitive.Root,
136
- {
137
- ref,
138
- className: cn(
139
- "hawa-flex hawa-gap-2",
140
- orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
141
- className
142
- ),
143
- ...props
144
- },
145
- /* @__PURE__ */ React2.createElement(TabsContext.Provider, { value: { orientation } }, props.children)
146
- ));
134
+ var Tabs = React2.forwardRef(
135
+ ({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React2.createElement(
136
+ TabsPrimitive.Root,
137
+ {
138
+ ref,
139
+ className: cn(
140
+ "hawa-flex hawa-gap-2",
141
+ orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
142
+ className
143
+ ),
144
+ ...props
145
+ },
146
+ /* @__PURE__ */ React2.createElement(TabsContext.Provider, { value: { orientation } }, props.children)
147
+ )
148
+ );
147
149
  Tabs.displayName = TabsPrimitive.Root.displayName;
148
150
  var TabsList = React2.forwardRef(({ className, ...props }, ref) => {
149
151
  const { orientation } = React2.useContext(TabsContext);
@@ -89,19 +89,21 @@ var Chip = React.forwardRef(
89
89
 
90
90
  // elements/tabs/Tabs.tsx
91
91
  var TabsContext = React2.createContext({ orientation: "vertical" });
92
- var Tabs = React2.forwardRef(({ className, orientation, ...props }, ref) => /* @__PURE__ */ React2.createElement(
93
- TabsPrimitive.Root,
94
- {
95
- ref,
96
- className: cn(
97
- "hawa-flex hawa-gap-2",
98
- orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
99
- className
100
- ),
101
- ...props
102
- },
103
- /* @__PURE__ */ React2.createElement(TabsContext.Provider, { value: { orientation } }, props.children)
104
- ));
92
+ var Tabs = React2.forwardRef(
93
+ ({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React2.createElement(
94
+ TabsPrimitive.Root,
95
+ {
96
+ ref,
97
+ className: cn(
98
+ "hawa-flex hawa-gap-2",
99
+ orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
100
+ className
101
+ ),
102
+ ...props
103
+ },
104
+ /* @__PURE__ */ React2.createElement(TabsContext.Provider, { value: { orientation } }, props.children)
105
+ )
106
+ );
105
107
  Tabs.displayName = TabsPrimitive.Root.displayName;
106
108
  var TabsList = React2.forwardRef(({ className, ...props }, ref) => {
107
109
  const { orientation } = React2.useContext(TabsContext);
@@ -10,6 +10,7 @@ type LabelProps = {
10
10
 
11
11
  interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
12
12
  helperText?: string;
13
+ isLoading?: boolean;
13
14
  /** The label of the input field */
14
15
  label?: any;
15
16
  labelProps?: LabelProps;
@@ -10,6 +10,7 @@ type LabelProps = {
10
10
 
11
11
  interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
12
12
  helperText?: string;
13
+ isLoading?: boolean;
13
14
  /** The label of the input field */
14
15
  label?: any;
15
16
  labelProps?: LabelProps;
@@ -35,7 +35,7 @@ __export(textarea_exports, {
35
35
  module.exports = __toCommonJS(textarea_exports);
36
36
 
37
37
  // elements/textarea/Textarea.tsx
38
- var React3 = __toESM(require("react"));
38
+ var React4 = __toESM(require("react"));
39
39
 
40
40
  // util/index.ts
41
41
  var import_clsx = require("clsx");
@@ -44,13 +44,40 @@ function cn(...inputs) {
44
44
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
45
45
  }
46
46
 
47
+ // elements/skeleton/Skeleton.tsx
48
+ var import_react = __toESM(require("react"));
49
+ function Skeleton({
50
+ className,
51
+ content,
52
+ animation = "pulse",
53
+ ...props
54
+ }) {
55
+ const animationStyles = {
56
+ none: "hawa-rounded hawa-bg-muted",
57
+ pulse: "hawa-animate-pulse hawa-rounded hawa-bg-muted",
58
+ shimmer: "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"
59
+ };
60
+ return /* @__PURE__ */ import_react.default.createElement(
61
+ "div",
62
+ {
63
+ className: cn(
64
+ animationStyles[animation],
65
+ content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
66
+ className
67
+ ),
68
+ ...props
69
+ },
70
+ content && content
71
+ );
72
+ }
73
+
47
74
  // elements/label/Label.tsx
48
- var React2 = __toESM(require("react"));
75
+ var React3 = __toESM(require("react"));
49
76
 
50
77
  // elements/tooltip/Tooltip.tsx
51
- var import_react = __toESM(require("react"));
78
+ var import_react2 = __toESM(require("react"));
52
79
  var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
53
- var TooltipContent = import_react.default.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ import_react.default.createElement(
80
+ var TooltipContent = import_react2.default.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ import_react2.default.createElement(
54
81
  TooltipPrimitive.Content,
55
82
  {
56
83
  ref,
@@ -63,7 +90,7 @@ var TooltipContent = import_react.default.forwardRef(({ className, sideOffset =
63
90
  }
64
91
  ));
65
92
  TooltipContent.displayName = TooltipPrimitive.Content.displayName;
66
- var TooltipArrow = import_react.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react.default.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
93
+ var TooltipArrow = import_react2.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
67
94
  TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
68
95
  var Tooltip = ({
69
96
  side,
@@ -78,13 +105,13 @@ var Tooltip = ({
78
105
  delayDuration = 300,
79
106
  ...props
80
107
  }) => {
81
- return /* @__PURE__ */ import_react.default.createElement(
108
+ return /* @__PURE__ */ import_react2.default.createElement(
82
109
  TooltipPrimitive.TooltipProvider,
83
110
  {
84
111
  delayDuration,
85
112
  ...providerProps
86
113
  },
87
- /* @__PURE__ */ import_react.default.createElement(
114
+ /* @__PURE__ */ import_react2.default.createElement(
88
115
  TooltipPrimitive.Root,
89
116
  {
90
117
  open,
@@ -92,14 +119,14 @@ var Tooltip = ({
92
119
  onOpenChange,
93
120
  ...props
94
121
  },
95
- /* @__PURE__ */ import_react.default.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
96
- /* @__PURE__ */ import_react.default.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
122
+ /* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
123
+ /* @__PURE__ */ import_react2.default.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
97
124
  )
98
125
  );
99
126
  };
100
127
 
101
128
  // elements/label/Label.tsx
102
- 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(
129
+ 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(
103
130
  "label",
104
131
  {
105
132
  ref,
@@ -110,8 +137,8 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
110
137
  ...props
111
138
  },
112
139
  children,
113
- required && /* @__PURE__ */ React2.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
114
- ), hint && /* @__PURE__ */ React2.createElement(
140
+ required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
141
+ ), hint && /* @__PURE__ */ React3.createElement(
115
142
  Tooltip,
116
143
  {
117
144
  content: hint,
@@ -121,7 +148,7 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
121
148
  onClick: (event) => event.preventDefault()
122
149
  }
123
150
  },
124
- /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
151
+ /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
125
152
  "svg",
126
153
  {
127
154
  xmlns: "http://www.w3.org/2000/svg",
@@ -133,15 +160,15 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
133
160
  strokeLinecap: "round",
134
161
  strokeLinejoin: "round"
135
162
  },
136
- /* @__PURE__ */ React2.createElement("circle", { cx: "12", cy: "12", r: "10" }),
137
- /* @__PURE__ */ React2.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
138
- /* @__PURE__ */ React2.createElement("path", { d: "M12 17h.01" })
163
+ /* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
164
+ /* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
165
+ /* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
139
166
  ))
140
167
  )));
141
168
  Label.displayName = "Label";
142
169
 
143
170
  // elements/textarea/Textarea.tsx
144
- var Textarea = React3.forwardRef(
171
+ var Textarea = React4.forwardRef(
145
172
  ({
146
173
  className,
147
174
  classNames,
@@ -150,9 +177,10 @@ var Textarea = React3.forwardRef(
150
177
  forceHideHelperText,
151
178
  textareaProps,
152
179
  countPosition = "bottom",
180
+ isLoading,
153
181
  ...props
154
182
  }, ref) => {
155
- return /* @__PURE__ */ React3.createElement(
183
+ return /* @__PURE__ */ React4.createElement(
156
184
  "div",
157
185
  {
158
186
  className: cn(
@@ -161,19 +189,27 @@ var Textarea = React3.forwardRef(
161
189
  className
162
190
  )
163
191
  },
164
- props.label && /* @__PURE__ */ React3.createElement(Label, { ...labelProps }, props.label),
165
- /* @__PURE__ */ React3.createElement(
192
+ /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, props.label && /* @__PURE__ */ React4.createElement(Label, { ...labelProps }, props.label), showCount && countPosition === "top" && /* @__PURE__ */ React4.createElement(
193
+ "div",
194
+ {
195
+ className: "hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none"
196
+ },
197
+ (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0,
198
+ "/",
199
+ textareaProps == null ? void 0 : textareaProps.maxLength
200
+ )),
201
+ isLoading ? /* @__PURE__ */ React4.createElement(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ React4.createElement(
166
202
  "textarea",
167
203
  {
168
204
  className: cn(
169
- "hawa-flex hawa-min-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50",
205
+ "hawa-flex hawa-min-h-[40px] hawa-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50",
170
206
  classNames == null ? void 0 : classNames.textarea
171
207
  ),
172
208
  ref,
173
209
  ...textareaProps
174
210
  }
175
211
  ),
176
- /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React3.createElement(
212
+ /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React4.createElement(
177
213
  "p",
178
214
  {
179
215
  className: cn(
@@ -182,20 +218,7 @@ var Textarea = React3.forwardRef(
182
218
  )
183
219
  },
184
220
  props.helperText
185
- ), showCount && /* @__PURE__ */ React3.createElement(
186
- "div",
187
- {
188
- className: cn(
189
- "hawa-text-start hawa-text-xs hawa-transition-all",
190
- {
191
- "hawa-absolute hawa-bottom-[80px] hawa-end-0 hawa-translate-y-1/2": countPosition === "top"
192
- }
193
- )
194
- },
195
- (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0,
196
- "/",
197
- textareaProps == null ? void 0 : textareaProps.maxLength
198
- ))
221
+ ), showCount && countPosition === "bottom" && /* @__PURE__ */ React4.createElement("div", { className: "hawa-text-start hawa-text-xs hawa-transition-all" }, (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0, "/", textareaProps == null ? void 0 : textareaProps.maxLength))
199
222
  );
200
223
  }
201
224
  );
@@ -3,15 +3,42 @@ import {
3
3
  } from "../chunk-TWNGV3RE.mjs";
4
4
 
5
5
  // elements/textarea/Textarea.tsx
6
- import * as React3 from "react";
6
+ import * as React4 from "react";
7
+
8
+ // elements/skeleton/Skeleton.tsx
9
+ import React from "react";
10
+ function Skeleton({
11
+ className,
12
+ content,
13
+ animation = "pulse",
14
+ ...props
15
+ }) {
16
+ const animationStyles = {
17
+ none: "hawa-rounded hawa-bg-muted",
18
+ pulse: "hawa-animate-pulse hawa-rounded hawa-bg-muted",
19
+ shimmer: "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"
20
+ };
21
+ return /* @__PURE__ */ React.createElement(
22
+ "div",
23
+ {
24
+ className: cn(
25
+ animationStyles[animation],
26
+ content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
27
+ className
28
+ ),
29
+ ...props
30
+ },
31
+ content && content
32
+ );
33
+ }
7
34
 
8
35
  // elements/label/Label.tsx
9
- import * as React2 from "react";
36
+ import * as React3 from "react";
10
37
 
11
38
  // elements/tooltip/Tooltip.tsx
12
- import React from "react";
39
+ import React2 from "react";
13
40
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
14
- var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React.createElement(
41
+ var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React2.createElement(
15
42
  TooltipPrimitive.Content,
16
43
  {
17
44
  ref,
@@ -24,7 +51,7 @@ var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props },
24
51
  }
25
52
  ));
26
53
  TooltipContent.displayName = TooltipPrimitive.Content.displayName;
27
- var TooltipArrow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
54
+ var TooltipArrow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
28
55
  TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
29
56
  var Tooltip = ({
30
57
  side,
@@ -39,13 +66,13 @@ var Tooltip = ({
39
66
  delayDuration = 300,
40
67
  ...props
41
68
  }) => {
42
- return /* @__PURE__ */ React.createElement(
69
+ return /* @__PURE__ */ React2.createElement(
43
70
  TooltipPrimitive.TooltipProvider,
44
71
  {
45
72
  delayDuration,
46
73
  ...providerProps
47
74
  },
48
- /* @__PURE__ */ React.createElement(
75
+ /* @__PURE__ */ React2.createElement(
49
76
  TooltipPrimitive.Root,
50
77
  {
51
78
  open,
@@ -53,14 +80,14 @@ var Tooltip = ({
53
80
  onOpenChange,
54
81
  ...props
55
82
  },
56
- /* @__PURE__ */ React.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
57
- /* @__PURE__ */ React.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
83
+ /* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
84
+ /* @__PURE__ */ React2.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
58
85
  )
59
86
  );
60
87
  };
61
88
 
62
89
  // elements/label/Label.tsx
63
- 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(
90
+ 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(
64
91
  "label",
65
92
  {
66
93
  ref,
@@ -71,8 +98,8 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
71
98
  ...props
72
99
  },
73
100
  children,
74
- required && /* @__PURE__ */ React2.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
75
- ), hint && /* @__PURE__ */ React2.createElement(
101
+ required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
102
+ ), hint && /* @__PURE__ */ React3.createElement(
76
103
  Tooltip,
77
104
  {
78
105
  content: hint,
@@ -82,7 +109,7 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
82
109
  onClick: (event) => event.preventDefault()
83
110
  }
84
111
  },
85
- /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
112
+ /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
86
113
  "svg",
87
114
  {
88
115
  xmlns: "http://www.w3.org/2000/svg",
@@ -94,15 +121,15 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
94
121
  strokeLinecap: "round",
95
122
  strokeLinejoin: "round"
96
123
  },
97
- /* @__PURE__ */ React2.createElement("circle", { cx: "12", cy: "12", r: "10" }),
98
- /* @__PURE__ */ React2.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
99
- /* @__PURE__ */ React2.createElement("path", { d: "M12 17h.01" })
124
+ /* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
125
+ /* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
126
+ /* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
100
127
  ))
101
128
  )));
102
129
  Label.displayName = "Label";
103
130
 
104
131
  // elements/textarea/Textarea.tsx
105
- var Textarea = React3.forwardRef(
132
+ var Textarea = React4.forwardRef(
106
133
  ({
107
134
  className,
108
135
  classNames,
@@ -111,9 +138,10 @@ var Textarea = React3.forwardRef(
111
138
  forceHideHelperText,
112
139
  textareaProps,
113
140
  countPosition = "bottom",
141
+ isLoading,
114
142
  ...props
115
143
  }, ref) => {
116
- return /* @__PURE__ */ React3.createElement(
144
+ return /* @__PURE__ */ React4.createElement(
117
145
  "div",
118
146
  {
119
147
  className: cn(
@@ -122,19 +150,27 @@ var Textarea = React3.forwardRef(
122
150
  className
123
151
  )
124
152
  },
125
- props.label && /* @__PURE__ */ React3.createElement(Label, { ...labelProps }, props.label),
126
- /* @__PURE__ */ React3.createElement(
153
+ /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, props.label && /* @__PURE__ */ React4.createElement(Label, { ...labelProps }, props.label), showCount && countPosition === "top" && /* @__PURE__ */ React4.createElement(
154
+ "div",
155
+ {
156
+ className: "hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none"
157
+ },
158
+ (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0,
159
+ "/",
160
+ textareaProps == null ? void 0 : textareaProps.maxLength
161
+ )),
162
+ isLoading ? /* @__PURE__ */ React4.createElement(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ React4.createElement(
127
163
  "textarea",
128
164
  {
129
165
  className: cn(
130
- "hawa-flex hawa-min-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50",
166
+ "hawa-flex hawa-min-h-[40px] hawa-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50",
131
167
  classNames == null ? void 0 : classNames.textarea
132
168
  ),
133
169
  ref,
134
170
  ...textareaProps
135
171
  }
136
172
  ),
137
- /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React3.createElement(
173
+ /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React4.createElement(
138
174
  "p",
139
175
  {
140
176
  className: cn(
@@ -143,20 +179,7 @@ var Textarea = React3.forwardRef(
143
179
  )
144
180
  },
145
181
  props.helperText
146
- ), showCount && /* @__PURE__ */ React3.createElement(
147
- "div",
148
- {
149
- className: cn(
150
- "hawa-text-start hawa-text-xs hawa-transition-all",
151
- {
152
- "hawa-absolute hawa-bottom-[80px] hawa-end-0 hawa-translate-y-1/2": countPosition === "top"
153
- }
154
- )
155
- },
156
- (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0,
157
- "/",
158
- textareaProps == null ? void 0 : textareaProps.maxLength
159
- ))
182
+ ), showCount && countPosition === "bottom" && /* @__PURE__ */ React4.createElement("div", { className: "hawa-text-start hawa-text-xs hawa-transition-all" }, (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0, "/", textareaProps == null ? void 0 : textareaProps.maxLength))
160
183
  );
161
184
  }
162
185
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.26.21",
3
+ "version": "0.26.22",
4
4
  "description": "Modern UI Kit made with Tailwind",
5
5
  "author": {
6
6
  "name": "Sikka Software",
@@ -1,4 +0,0 @@
1
- type OrientationType = "vertical" | "horizontal";
2
- type RadiusType = "full" | "inherit" | "none";
3
-
4
- export type { OrientationType as O, RadiusType as R };
@@ -1,4 +0,0 @@
1
- type OrientationType = "vertical" | "horizontal";
2
- type RadiusType = "full" | "inherit" | "none";
3
-
4
- export type { OrientationType as O, RadiusType as R };
File without changes