@sikka/hawa 0.37.2-next → 0.38.1-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Radio-y9uhxitu.d.ts → Radio-lgoClQrv.d.ts} +2 -2
- package/dist/{Radio-BCD7k628.d.mts → Radio-uQ7DtzcI.d.mts} +2 -2
- package/dist/alert/index.js +43 -19
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +43 -19
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.js +43 -19
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +43 -19
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/backToTop/index.js +43 -19
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +43 -19
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/blocks/auth/index.d.mts +1 -0
- package/dist/blocks/auth/index.d.ts +1 -0
- package/dist/blocks/auth/index.js +251 -143
- package/dist/blocks/auth/index.mjs +205 -102
- package/dist/blocks/feedback/index.js +47 -59
- package/dist/blocks/feedback/index.mjs +5 -5
- package/dist/blocks/index.d.mts +2 -1
- package/dist/blocks/index.d.ts +2 -1
- package/dist/blocks/index.js +501 -420
- package/dist/blocks/index.mjs +11 -9
- package/dist/blocks/misc/index.js +48 -51
- package/dist/blocks/misc/index.mjs +5 -5
- package/dist/blocks/pricing/index.js +47 -41
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/button/index.d.mts +4 -0
- package/dist/button/index.d.ts +4 -0
- package/dist/button/index.js +43 -19
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +43 -19
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js +43 -19
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +43 -19
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/checkbox/index.d.mts +1 -1
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/{chunk-ZTUWU652.mjs → chunk-EZBHA2IL.mjs} +3 -3
- package/dist/{chunk-ODOCZAWC.mjs → chunk-F23GAE2P.mjs} +1 -1
- package/dist/{chunk-DS3AACQJ.mjs → chunk-IC5WYNKN.mjs} +1 -1
- package/dist/{chunk-QXH7ZDMN.mjs → chunk-RTK6REIK.mjs} +3 -11
- package/dist/{chunk-QYWOI3DO.mjs → chunk-UDJFVH2I.mjs} +204 -144
- package/dist/{chunk-BPHQFAWM.mjs → chunk-UJ5SXC3M.mjs} +3 -11
- package/dist/{chunk-PXGL7ZXQ.mjs → chunk-UMOBOCED.mjs} +44 -19
- package/dist/{chunk-RNFJAEEU.mjs → chunk-V7O5MQZQ.mjs} +44 -19
- package/dist/{chunk-BTDR3VAG.mjs → chunk-WDCKXU54.mjs} +4 -21
- package/dist/{chunk-MDHDHEPZ.mjs → chunk-XFSBC5VI.mjs} +3 -11
- package/dist/codeBlock/index.js +43 -19
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +43 -19
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.d.mts +1 -1
- package/dist/colorPicker/index.d.ts +1 -1
- package/dist/colorPicker/index.js +35 -31
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +33 -29
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.d.mts +1 -1
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.js +52 -48
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +52 -48
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/dataTable/index.js +44 -29
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +44 -29
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.d.mts +4 -0
- package/dist/datePicker/index.d.ts +4 -0
- package/dist/datePicker/index.js +44 -19
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +44 -19
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +43 -19
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +43 -19
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +46 -21
- package/dist/elements/index.d.ts +46 -21
- package/dist/elements/index.js +378 -309
- package/dist/elements/index.mjs +14 -23
- package/dist/fileDropzone/index.js +43 -19
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +43 -19
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/index.css +29 -3
- package/dist/index.d.mts +48 -22
- package/dist/index.d.ts +48 -22
- package/dist/index.js +808 -737
- package/dist/index.mjs +331 -264
- package/dist/input/index.d.mts +1 -1
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +46 -42
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +45 -41
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js +64 -69
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +57 -62
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +43 -19
- package/dist/layout/index.mjs +2 -2
- package/dist/passwordInput/index.js +70 -66
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +59 -55
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +50 -55
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +47 -52
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.d.mts +37 -16
- package/dist/pinInput/index.d.ts +37 -16
- package/dist/pinInput/index.js +208 -78
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +203 -77
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/radio/index.d.mts +1 -1
- package/dist/radio/index.d.ts +1 -1
- package/dist/radio/index.js +55 -60
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +50 -55
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.js +2 -2
- package/dist/scrollArea/index.js.map +1 -1
- package/dist/scrollArea/index.mjs +2 -2
- package/dist/scrollArea/index.mjs.map +1 -1
- package/dist/select/index.d.mts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/select/index.js +43 -39
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +43 -39
- package/dist/select/index.mjs.map +1 -1
- package/dist/signature/index.d.mts +1 -1
- package/dist/signature/index.d.ts +1 -1
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/index.mjs.map +1 -1
- package/dist/sortButton/index.js +43 -19
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs +43 -19
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.d.mts +4 -0
- package/dist/splitButton/index.d.ts +4 -0
- package/dist/splitButton/index.js +43 -19
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +43 -19
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/stats/index.d.mts +1 -1
- package/dist/stats/index.d.ts +1 -1
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs.map +1 -1
- package/dist/tabs/index.js +2 -2
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +2 -2
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.d.mts +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/textarea/index.js +34 -30
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +34 -30
- package/dist/textarea/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/select/index.d.mts
CHANGED
package/dist/select/index.d.ts
CHANGED
package/dist/select/index.js
CHANGED
@@ -36,7 +36,7 @@ __export(select_exports, {
|
|
36
36
|
module.exports = __toCommonJS(select_exports);
|
37
37
|
|
38
38
|
// elements/select/Select.tsx
|
39
|
-
var
|
39
|
+
var import_react4 = __toESM(require("react"));
|
40
40
|
var import_react_select = __toESM(require("react-select"));
|
41
41
|
var import_creatable = __toESM(require("react-select/creatable"));
|
42
42
|
|
@@ -50,13 +50,26 @@ function cn(...inputs) {
|
|
50
50
|
// elements/select/Select.tsx
|
51
51
|
var import_clsx2 = __toESM(require("clsx"));
|
52
52
|
|
53
|
+
// elements/helperText/HelperText.tsx
|
54
|
+
var import_react = __toESM(require("react"));
|
55
|
+
var HelperText = ({ helperText }) => /* @__PURE__ */ import_react.default.createElement(
|
56
|
+
"p",
|
57
|
+
{
|
58
|
+
className: cn(
|
59
|
+
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
60
|
+
helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
61
|
+
)
|
62
|
+
},
|
63
|
+
helperText
|
64
|
+
);
|
65
|
+
|
53
66
|
// elements/label/Label.tsx
|
54
|
-
var
|
67
|
+
var React3 = __toESM(require("react"));
|
55
68
|
|
56
69
|
// elements/tooltip/Tooltip.tsx
|
57
|
-
var
|
70
|
+
var import_react2 = __toESM(require("react"));
|
58
71
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
59
|
-
var TooltipContent =
|
72
|
+
var TooltipContent = import_react2.default.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ import_react2.default.createElement(
|
60
73
|
TooltipPrimitive.Content,
|
61
74
|
{
|
62
75
|
ref,
|
@@ -73,7 +86,7 @@ var TooltipContent = import_react.default.forwardRef(({ className, sideOffset =
|
|
73
86
|
}
|
74
87
|
));
|
75
88
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
76
|
-
var TooltipArrow =
|
89
|
+
var TooltipArrow = import_react2.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
|
77
90
|
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
78
91
|
var Tooltip = ({
|
79
92
|
side,
|
@@ -90,13 +103,13 @@ var Tooltip = ({
|
|
90
103
|
delayDuration = 300,
|
91
104
|
...props
|
92
105
|
}) => {
|
93
|
-
return /* @__PURE__ */
|
106
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
94
107
|
TooltipPrimitive.TooltipProvider,
|
95
108
|
{
|
96
109
|
delayDuration,
|
97
110
|
...providerProps
|
98
111
|
},
|
99
|
-
/* @__PURE__ */
|
112
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
100
113
|
TooltipPrimitive.Root,
|
101
114
|
{
|
102
115
|
open: !disabled && open,
|
@@ -104,8 +117,8 @@ var Tooltip = ({
|
|
104
117
|
onOpenChange,
|
105
118
|
...props
|
106
119
|
},
|
107
|
-
/* @__PURE__ */
|
108
|
-
/* @__PURE__ */
|
120
|
+
/* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
121
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
109
122
|
TooltipContent,
|
110
123
|
{
|
111
124
|
size,
|
@@ -125,7 +138,7 @@ var Tooltip = ({
|
|
125
138
|
};
|
126
139
|
|
127
140
|
// elements/label/Label.tsx
|
128
|
-
var Label =
|
141
|
+
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(
|
129
142
|
"label",
|
130
143
|
{
|
131
144
|
ref,
|
@@ -136,8 +149,8 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
136
149
|
...props
|
137
150
|
},
|
138
151
|
children,
|
139
|
-
required && /* @__PURE__ */
|
140
|
-
), hint && /* @__PURE__ */
|
152
|
+
required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
|
153
|
+
), hint && /* @__PURE__ */ React3.createElement(
|
141
154
|
Tooltip,
|
142
155
|
{
|
143
156
|
content: hint,
|
@@ -147,7 +160,7 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
147
160
|
onClick: (event) => event.preventDefault()
|
148
161
|
}
|
149
162
|
},
|
150
|
-
/* @__PURE__ */
|
163
|
+
/* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
|
151
164
|
"svg",
|
152
165
|
{
|
153
166
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -159,15 +172,15 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
159
172
|
strokeLinecap: "round",
|
160
173
|
strokeLinejoin: "round"
|
161
174
|
},
|
162
|
-
/* @__PURE__ */
|
163
|
-
/* @__PURE__ */
|
164
|
-
/* @__PURE__ */
|
175
|
+
/* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
176
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
177
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
|
165
178
|
))
|
166
179
|
)));
|
167
180
|
Label.displayName = "Label";
|
168
181
|
|
169
182
|
// elements/skeleton/Skeleton.tsx
|
170
|
-
var
|
183
|
+
var import_react3 = __toESM(require("react"));
|
171
184
|
function Skeleton({
|
172
185
|
className,
|
173
186
|
content,
|
@@ -186,7 +199,7 @@ function Skeleton({
|
|
186
199
|
right: "hawa-mask-fade-right",
|
187
200
|
left: "hawa-mask-fade-left "
|
188
201
|
};
|
189
|
-
return /* @__PURE__ */
|
202
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
190
203
|
"div",
|
191
204
|
{
|
192
205
|
className: cn(
|
@@ -209,10 +222,10 @@ var Select = ({
|
|
209
222
|
}) => {
|
210
223
|
const NoOption = () => {
|
211
224
|
var _a, _b;
|
212
|
-
return /* @__PURE__ */
|
225
|
+
return /* @__PURE__ */ import_react4.default.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
|
213
226
|
};
|
214
227
|
const Control = ({ children, innerProps, innerRef }) => {
|
215
|
-
return /* @__PURE__ */
|
228
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
216
229
|
"div",
|
217
230
|
{
|
218
231
|
ref: innerRef,
|
@@ -225,7 +238,7 @@ var Select = ({
|
|
225
238
|
);
|
226
239
|
};
|
227
240
|
const Option = ({ children, innerProps, innerRef }) => {
|
228
|
-
return /* @__PURE__ */
|
241
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
229
242
|
"div",
|
230
243
|
{
|
231
244
|
ref: innerRef,
|
@@ -246,7 +259,7 @@ var Select = ({
|
|
246
259
|
...menuProps
|
247
260
|
}) => {
|
248
261
|
const menuOpen = menuProps.selectProps.menuIsOpen;
|
249
|
-
return /* @__PURE__ */
|
262
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
250
263
|
"div",
|
251
264
|
{
|
252
265
|
className: cn(
|
@@ -264,7 +277,7 @@ var Select = ({
|
|
264
277
|
let selectContainerStyles = "hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm";
|
265
278
|
let selectPlaceholderStyles = "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1";
|
266
279
|
let selectIndicatorContainerStyles = "hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ";
|
267
|
-
return /* @__PURE__ */
|
280
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
268
281
|
"div",
|
269
282
|
{
|
270
283
|
className: cn(
|
@@ -272,10 +285,10 @@ var Select = ({
|
|
272
285
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
273
286
|
)
|
274
287
|
},
|
275
|
-
props.label && /* @__PURE__ */
|
276
|
-
props.isLoading ? /* @__PURE__ */
|
288
|
+
props.label && /* @__PURE__ */ import_react4.default.createElement(Label, { ...labelProps }, props.label),
|
289
|
+
props.isLoading ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
277
290
|
// TODO: enable keyboard to go to the next item in the list
|
278
|
-
/* @__PURE__ */
|
291
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
279
292
|
import_react_select.default,
|
280
293
|
{
|
281
294
|
noOptionsMessage: NoOption,
|
@@ -309,7 +322,7 @@ var Select = ({
|
|
309
322
|
// {...e}
|
310
323
|
// />
|
311
324
|
// ),
|
312
|
-
ValueContainer: (e) => /* @__PURE__ */
|
325
|
+
ValueContainer: (e) => /* @__PURE__ */ import_react4.default.createElement(
|
313
326
|
"div",
|
314
327
|
{
|
315
328
|
className: cn(
|
@@ -319,7 +332,7 @@ var Select = ({
|
|
319
332
|
...e
|
320
333
|
}
|
321
334
|
),
|
322
|
-
MultiValueContainer: (e) => /* @__PURE__ */
|
335
|
+
MultiValueContainer: (e) => /* @__PURE__ */ import_react4.default.createElement(
|
323
336
|
"div",
|
324
337
|
{
|
325
338
|
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
@@ -338,7 +351,7 @@ var Select = ({
|
|
338
351
|
isSearchable: props.isSearchable
|
339
352
|
}
|
340
353
|
)
|
341
|
-
) : /* @__PURE__ */
|
354
|
+
) : /* @__PURE__ */ import_react4.default.createElement(
|
342
355
|
import_creatable.default,
|
343
356
|
{
|
344
357
|
formatCreateLabel: (inputValue) => {
|
@@ -368,16 +381,7 @@ var Select = ({
|
|
368
381
|
onInputChange: (newValue, action) => props.onInputChange(newValue, action)
|
369
382
|
}
|
370
383
|
),
|
371
|
-
!props.hideHelperText && /* @__PURE__ */
|
372
|
-
"p",
|
373
|
-
{
|
374
|
-
className: cn(
|
375
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
376
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
377
|
-
)
|
378
|
-
},
|
379
|
-
props.helperText
|
380
|
-
)
|
384
|
+
!props.hideHelperText && /* @__PURE__ */ import_react4.default.createElement(HelperText, { helperText: props.helperText })
|
381
385
|
);
|
382
386
|
};
|
383
387
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/select/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/select/index.ts","../../elements/select/Select.tsx","../../util/index.ts","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Select\";","import React, { FC } from \"react\";\nimport ReactSelect, { MenuProps } from \"react-select\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { cn } from \"@util/index\";\nimport clsx from \"clsx\";\n\nimport { Label, LabelProps } from \"../label\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ControlTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\n// The options container\ntype MenuTypes = MenuProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n};\n\n// The single options\ntype OptionTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\nexport type SelectOptionProps = {\n value: any;\n label: any;\n};\n\ntype SelectTypes = {\n label?: string;\n hideHelperText?: boolean;\n options: SelectOptionProps[];\n labelKey?: string;\n isCreatable?: boolean;\n isClearable?: boolean;\n isMulti?: boolean;\n isSearchable?: boolean;\n controlClassNames?: string;\n containerClassNames?: string;\n onChange: any;\n helperText?: string;\n onInputChange?: any;\n native?: any;\n width?: \"full\" | \"small\" | \"fit\";\n value?: any;\n children?: any;\n getOptionLabel?: any;\n disabled?: boolean;\n defaultValue?: any;\n handleCreateOption?: () => void;\n placeholder?: string;\n hideIndicator?: boolean;\n phoneCode?: boolean;\n isLoading?: any;\n labelProps?: LabelProps;\n texts?: {\n noOptions?: string;\n createLabel?: string;\n };\n};\n\nexport const Select: FC<SelectTypes> = ({\n labelProps,\n labelKey = \"label\",\n ...props\n}) => {\n const NoOption = () => {\n return <div>{props.texts?.noOptions ?? \"No Items Found\"}</div>;\n };\n const Control: FC<ControlTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={clsx(\n \"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Option: FC<OptionTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={cn(\n \"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all hover:hawa-bg-primary hover:hawa-text-primary-foreground\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Menu: FC<MenuTypes> = ({\n cx,\n children,\n getStyles,\n innerProps,\n innerRef,\n ...menuProps\n }) => {\n const menuOpen = menuProps.selectProps.menuIsOpen;\n return (\n <div\n className={cn(\n \"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md\",\n props.phoneCode ? \"hawa-p-1.5\" : \"hawa-w-full hawa-p-1.5\",\n menuOpen && \"hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 \",\n )}\n ref={innerRef}\n {...innerProps}\n // {...props}\n >\n {children}\n </div>\n );\n };\n\n let phoneCodeStyles =\n \"hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]\";\n let selectContainerStyles =\n \"hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm\";\n let selectPlaceholderStyles =\n \"hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1\";\n let selectIndicatorContainerStyles =\n \"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] \";\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {props.isLoading ? (\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n ) : !props.isCreatable ? (\n // TODO: enable keyboard to go to the next item in the list\n <ReactSelect\n noOptionsMessage={NoOption}\n classNames={{\n control: () =>\n cn(\n props.phoneCode && \"hawa-rounded-r-none\",\n props.controlClassNames,\n ),\n container: () =>\n cn(\n selectContainerStyles,\n props.phoneCode && phoneCodeStyles,\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n props.isMulti && \"hawa-ps-0 \",\n ),\n placeholder: () => selectPlaceholderStyles,\n valueContainer: () => \"hawa-text-foreground hawa-px-1 \",\n singleValue: () => \"hawa-text-foreground\",\n indicatorsContainer: () =>\n cn(\n selectIndicatorContainerStyles,\n props.hideIndicator ? \"hawa-invisible\" : \"hawa-px-1\",\n ),\n }}\n unstyled\n autoFocus={false}\n components={\n props.hideIndicator\n ? { Option, Menu, IndicatorsContainer: () => null }\n : {\n Option,\n Menu,\n // Control: (e) => (\n // <div\n // className={cn(e.className, \"hawa-flex hawa-flex-row\")}\n // {...e}\n // />\n // ),\n\n ValueContainer: (e) => (\n <div\n className={cn(\n e.className,\n \"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1\",\n )}\n {...e}\n />\n ),\n MultiValueContainer: (e) => (\n <div\n className=\"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row\"\n {...e}\n />\n ),\n }\n }\n onChange={(newValue: any, action) => props.onChange(newValue, action)}\n options={props.options}\n getOptionLabel={props.getOptionLabel}\n defaultValue={props.defaultValue}\n placeholder={props.placeholder}\n isDisabled={props.disabled}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n />\n ) : (\n <CreatableSelect\n formatCreateLabel={(inputValue) =>\n `${props.texts?.createLabel ?? \"Create\"} \"${inputValue}\"`\n }\n classNames={{\n container: () =>\n cn(\n \"hawa-rounded\",\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n ),\n placeholder: () => \"hawa-px-2 hawa-text-muted-foreground\",\n input: () => \"hawa-text-primary hawa-px-2\",\n valueContainer: () =>\n \"hawa-text-white dark:hawa-text-muted-foreground\",\n singleValue: () => \"hawa-text-black dark:hawa-text-white hawa-px-2\",\n indicatorsContainer: () =>\n \" hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground\",\n }}\n unstyled\n options={props.options}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n placeholder={props.placeholder}\n onCreateOption={props.handleCreateOption}\n onChange={(newValue, action) => props.onChange(newValue, action)}\n components={{ Control, Option, Menu }}\n onInputChange={(newValue, action) =>\n props.onInputChange(newValue, action)\n }\n />\n )}\n {!props.hideHelperText && (\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 </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * 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,gBAA0B;AAC1B,0BAAuC;AACvC,uBAA4B;;;ACF5B,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAAC,eAAiB;;;AELjB,IAAAC,SAAuB;;;ACAvB,mBAAkB;AAElB,uBAAkC;AAKlC,IAAM,iBAAiB,aAAAC,QAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,6BAAAA,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,eAAe,cAA+B,yBAAQ;AAEtD,IAAM,eAAe,aAAAA,QAAM,WAGzB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,6BAAAA,QAAA,cAAkB,wBAAjB,EAAuB,KAAU,WAAW,GAAG,SAAS,GAAI,GAAG,OAAO,CACxE;AACD,aAAa,cAA+B,uBAAM;AA0BlD,IAAM,UAAiD,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,GAAG;AACL,MAAM;AACJ,SACE,6BAAAA,QAAA;AAAA,IAAk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AM;AAAA,QACtB,UAAU,CAAC,UAAU,WAAW,MAAM,SAAS,UAAU,MAAM;AAAA,QAC/D,YAAY,EAAE,SAAS,QAAQ,KAAK;AAAA,QACpC,eAAe,CAAC,UAAU,WACxB,MAAM,cAAc,UAAU,MAAM;AAAA;AAAA,IAExC;AAAA,IAED,CAAC,MAAM,kBACN,8BAAAH,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,MAAM,aACF,8BACA;AAAA,QACN;AAAA;AAAA,MAEC,MAAM;AAAA,IACT;AAAA,EAEJ;AAEJ;","names":["import_react","import_clsx","React","React","import_react","React","React","clsx","ReactSelect","CreatableSelect"]}
|
1
|
+
{"version":3,"sources":["../../elements/select/index.ts","../../elements/select/Select.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Select\";","import React, { FC } from \"react\";\nimport ReactSelect, { MenuProps } from \"react-select\";\nimport CreatableSelect from \"react-select/creatable\";\n\nimport { cn } from \"@util/index\";\nimport clsx from \"clsx\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Skeleton } from \"../skeleton\";\n\ntype ControlTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\n// The options container\ntype MenuTypes = MenuProps & {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n};\n\n// The single options\ntype OptionTypes = {\n cx: any;\n children: any;\n getStyles: any;\n innerProps: any;\n innerRef: any;\n size?: \"small\" | \"normal\" | \"large\";\n};\n\nexport type SelectOptionProps = {\n value: any;\n label: any;\n};\n\ntype SelectTypes = {\n label?: string;\n hideHelperText?: boolean;\n options: SelectOptionProps[];\n labelKey?: string;\n isCreatable?: boolean;\n isClearable?: boolean;\n isMulti?: boolean;\n isSearchable?: boolean;\n controlClassNames?: string;\n containerClassNames?: string;\n onChange: any;\n helperText?: any;\n onInputChange?: any;\n native?: any;\n width?: \"full\" | \"small\" | \"fit\";\n value?: any;\n children?: any;\n getOptionLabel?: any;\n disabled?: boolean;\n defaultValue?: any;\n handleCreateOption?: () => void;\n placeholder?: string;\n hideIndicator?: boolean;\n phoneCode?: boolean;\n isLoading?: any;\n labelProps?: LabelProps;\n texts?: {\n noOptions?: string;\n createLabel?: string;\n };\n};\n\nexport const Select: FC<SelectTypes> = ({\n labelProps,\n labelKey = \"label\",\n ...props\n}) => {\n const NoOption = () => {\n return <div>{props.texts?.noOptions ?? \"No Items Found\"}</div>;\n };\n const Control: FC<ControlTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={clsx(\n \"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Option: FC<OptionTypes> = ({ children, innerProps, innerRef }) => {\n return (\n <div\n ref={innerRef}\n className={cn(\n \"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all hover:hawa-bg-primary hover:hawa-text-primary-foreground\",\n )}\n {...innerProps}\n >\n {children}\n </div>\n );\n };\n const Menu: FC<MenuTypes> = ({\n cx,\n children,\n getStyles,\n innerProps,\n innerRef,\n ...menuProps\n }) => {\n const menuOpen = menuProps.selectProps.menuIsOpen;\n return (\n <div\n className={cn(\n \"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md\",\n props.phoneCode ? \"hawa-p-1.5\" : \"hawa-w-full hawa-p-1.5\",\n menuOpen && \"hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 \",\n )}\n ref={innerRef}\n {...innerProps}\n // {...props}\n >\n {children}\n </div>\n );\n };\n\n let phoneCodeStyles =\n \"hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]\";\n let selectContainerStyles =\n \"hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm\";\n let selectPlaceholderStyles =\n \"hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1\";\n let selectIndicatorContainerStyles =\n \"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] \";\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n props.width === \"fit\" ? \"hawa-w-fit\" : \"hawa-w-full\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n {props.isLoading ? (\n <Skeleton className=\"hawa-h-[40px] hawa-w-full\" />\n ) : !props.isCreatable ? (\n // TODO: enable keyboard to go to the next item in the list\n <ReactSelect\n noOptionsMessage={NoOption}\n classNames={{\n control: () =>\n cn(\n props.phoneCode && \"hawa-rounded-r-none\",\n props.controlClassNames,\n ),\n container: () =>\n cn(\n selectContainerStyles,\n props.phoneCode && phoneCodeStyles,\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n props.isMulti && \"hawa-ps-0 \",\n ),\n placeholder: () => selectPlaceholderStyles,\n valueContainer: () => \"hawa-text-foreground hawa-px-1 \",\n singleValue: () => \"hawa-text-foreground\",\n indicatorsContainer: () =>\n cn(\n selectIndicatorContainerStyles,\n props.hideIndicator ? \"hawa-invisible\" : \"hawa-px-1\",\n ),\n }}\n unstyled\n autoFocus={false}\n components={\n props.hideIndicator\n ? { Option, Menu, IndicatorsContainer: () => null }\n : {\n Option,\n Menu,\n // Control: (e) => (\n // <div\n // className={cn(e.className, \"hawa-flex hawa-flex-row\")}\n // {...e}\n // />\n // ),\n\n ValueContainer: (e) => (\n <div\n className={cn(\n e.className,\n \"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1\",\n )}\n {...e}\n />\n ),\n MultiValueContainer: (e) => (\n <div\n className=\"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row\"\n {...e}\n />\n ),\n }\n }\n onChange={(newValue: any, action) => props.onChange(newValue, action)}\n options={props.options}\n getOptionLabel={props.getOptionLabel}\n defaultValue={props.defaultValue}\n placeholder={props.placeholder}\n isDisabled={props.disabled}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n />\n ) : (\n <CreatableSelect\n formatCreateLabel={(inputValue) =>\n `${props.texts?.createLabel ?? \"Create\"} \"${inputValue}\"`\n }\n classNames={{\n container: () =>\n cn(\n \"hawa-rounded\",\n props.disabled\n ? \"hawa-cursor-not-allowed\"\n : \"hawa-cursor-pointer\",\n ),\n placeholder: () => \"hawa-px-2 hawa-text-muted-foreground\",\n input: () => \"hawa-text-primary hawa-px-2\",\n valueContainer: () =>\n \"hawa-text-white dark:hawa-text-muted-foreground\",\n singleValue: () => \"hawa-text-black dark:hawa-text-white hawa-px-2\",\n indicatorsContainer: () =>\n \" hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground\",\n }}\n unstyled\n options={props.options}\n isClearable={props.isClearable}\n isMulti={props.isMulti}\n isSearchable={props.isSearchable}\n placeholder={props.placeholder}\n onCreateOption={props.handleCreateOption}\n onChange={(newValue, action) => props.onChange(newValue, action)}\n components={{ Control, Option, Menu }}\n onInputChange={(newValue, action) =>\n props.onInputChange(newValue, action)\n }\n />\n )}\n {!props.hideHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ 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,gBAA0B;AAC1B,0BAAuC;AACvC,uBAA4B;;;ACF5B,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAAC,eAAiB;;;AELjB,mBAAkB;AAIX,IAAM,aAAa,CAAC,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,eAAe,cAA+B,yBAAQ;AAEtD,IAAM,eAAe,cAAAA,QAAM,WAGzB,CAAC,EAAE,WAAW,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YAAY;AAAA,UACV,WAAW,MACT;AAAA,YACE;AAAA,YACA,MAAM,WACF,4BACA;AAAA,UACN;AAAA,UACF,aAAa,MAAM;AAAA,UACnB,OAAO,MAAM;AAAA,UACb,gBAAgB,MACd;AAAA,UACF,aAAa,MAAM;AAAA,UACnB,qBAAqB,MACnB;AAAA,QACJ;AAAA,QACA,UAAQ;AAAA,QACR,SAAS,MAAM;AAAA,QACf,aAAa,MAAM;AAAA,QACnB,SAAS,MAAM;AAAA,QACf,cAAc,MAAM;AAAA,QACpB,aAAa,MAAM;AAAA,QACnB,gBAAgB,MAAM;AAAA,QACtB,UAAU,CAAC,UAAU,WAAW,MAAM,SAAS,UAAU,MAAM;AAAA,QAC/D,YAAY,EAAE,SAAS,QAAQ,KAAK;AAAA,QACpC,eAAe,CAAC,UAAU,WACxB,MAAM,cAAc,UAAU,MAAM;AAAA;AAAA,IAExC;AAAA,IAED,CAAC,MAAM,kBAAkB,8BAAAH,QAAA,cAAC,cAAW,YAAY,MAAM,YAAY;AAAA,EACtE;AAEJ;","names":["import_react","import_clsx","React","React","import_react","React","import_react","React","React","clsx","ReactSelect","CreatableSelect"]}
|
package/dist/select/index.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
// elements/select/Select.tsx
|
4
|
-
import
|
4
|
+
import React5 from "react";
|
5
5
|
import ReactSelect from "react-select";
|
6
6
|
import CreatableSelect from "react-select/creatable";
|
7
7
|
|
@@ -15,13 +15,26 @@ function cn(...inputs) {
|
|
15
15
|
// elements/select/Select.tsx
|
16
16
|
import clsx2 from "clsx";
|
17
17
|
|
18
|
+
// elements/helperText/HelperText.tsx
|
19
|
+
import React from "react";
|
20
|
+
var HelperText = ({ helperText }) => /* @__PURE__ */ React.createElement(
|
21
|
+
"p",
|
22
|
+
{
|
23
|
+
className: cn(
|
24
|
+
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
25
|
+
helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
26
|
+
)
|
27
|
+
},
|
28
|
+
helperText
|
29
|
+
);
|
30
|
+
|
18
31
|
// elements/label/Label.tsx
|
19
|
-
import * as
|
32
|
+
import * as React3 from "react";
|
20
33
|
|
21
34
|
// elements/tooltip/Tooltip.tsx
|
22
|
-
import
|
35
|
+
import React2 from "react";
|
23
36
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
24
|
-
var TooltipContent =
|
37
|
+
var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
25
38
|
TooltipPrimitive.Content,
|
26
39
|
{
|
27
40
|
ref,
|
@@ -38,7 +51,7 @@ var TooltipContent = React.forwardRef(({ className, sideOffset = 4, size = "defa
|
|
38
51
|
}
|
39
52
|
));
|
40
53
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
41
|
-
var TooltipArrow =
|
54
|
+
var TooltipArrow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
|
42
55
|
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
43
56
|
var Tooltip = ({
|
44
57
|
side,
|
@@ -55,13 +68,13 @@ var Tooltip = ({
|
|
55
68
|
delayDuration = 300,
|
56
69
|
...props
|
57
70
|
}) => {
|
58
|
-
return /* @__PURE__ */
|
71
|
+
return /* @__PURE__ */ React2.createElement(
|
59
72
|
TooltipPrimitive.TooltipProvider,
|
60
73
|
{
|
61
74
|
delayDuration,
|
62
75
|
...providerProps
|
63
76
|
},
|
64
|
-
/* @__PURE__ */
|
77
|
+
/* @__PURE__ */ React2.createElement(
|
65
78
|
TooltipPrimitive.Root,
|
66
79
|
{
|
67
80
|
open: !disabled && open,
|
@@ -69,8 +82,8 @@ var Tooltip = ({
|
|
69
82
|
onOpenChange,
|
70
83
|
...props
|
71
84
|
},
|
72
|
-
/* @__PURE__ */
|
73
|
-
/* @__PURE__ */
|
85
|
+
/* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
86
|
+
/* @__PURE__ */ React2.createElement(
|
74
87
|
TooltipContent,
|
75
88
|
{
|
76
89
|
size,
|
@@ -90,7 +103,7 @@ var Tooltip = ({
|
|
90
103
|
};
|
91
104
|
|
92
105
|
// elements/label/Label.tsx
|
93
|
-
var Label =
|
106
|
+
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(
|
94
107
|
"label",
|
95
108
|
{
|
96
109
|
ref,
|
@@ -101,8 +114,8 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
101
114
|
...props
|
102
115
|
},
|
103
116
|
children,
|
104
|
-
required && /* @__PURE__ */
|
105
|
-
), hint && /* @__PURE__ */
|
117
|
+
required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
|
118
|
+
), hint && /* @__PURE__ */ React3.createElement(
|
106
119
|
Tooltip,
|
107
120
|
{
|
108
121
|
content: hint,
|
@@ -112,7 +125,7 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
112
125
|
onClick: (event) => event.preventDefault()
|
113
126
|
}
|
114
127
|
},
|
115
|
-
/* @__PURE__ */
|
128
|
+
/* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
|
116
129
|
"svg",
|
117
130
|
{
|
118
131
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -124,15 +137,15 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
124
137
|
strokeLinecap: "round",
|
125
138
|
strokeLinejoin: "round"
|
126
139
|
},
|
127
|
-
/* @__PURE__ */
|
128
|
-
/* @__PURE__ */
|
129
|
-
/* @__PURE__ */
|
140
|
+
/* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
141
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
142
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
|
130
143
|
))
|
131
144
|
)));
|
132
145
|
Label.displayName = "Label";
|
133
146
|
|
134
147
|
// elements/skeleton/Skeleton.tsx
|
135
|
-
import
|
148
|
+
import React4 from "react";
|
136
149
|
function Skeleton({
|
137
150
|
className,
|
138
151
|
content,
|
@@ -151,7 +164,7 @@ function Skeleton({
|
|
151
164
|
right: "hawa-mask-fade-right",
|
152
165
|
left: "hawa-mask-fade-left "
|
153
166
|
};
|
154
|
-
return /* @__PURE__ */
|
167
|
+
return /* @__PURE__ */ React4.createElement(
|
155
168
|
"div",
|
156
169
|
{
|
157
170
|
className: cn(
|
@@ -174,10 +187,10 @@ var Select = ({
|
|
174
187
|
}) => {
|
175
188
|
const NoOption = () => {
|
176
189
|
var _a, _b;
|
177
|
-
return /* @__PURE__ */
|
190
|
+
return /* @__PURE__ */ React5.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
|
178
191
|
};
|
179
192
|
const Control = ({ children, innerProps, innerRef }) => {
|
180
|
-
return /* @__PURE__ */
|
193
|
+
return /* @__PURE__ */ React5.createElement(
|
181
194
|
"div",
|
182
195
|
{
|
183
196
|
ref: innerRef,
|
@@ -190,7 +203,7 @@ var Select = ({
|
|
190
203
|
);
|
191
204
|
};
|
192
205
|
const Option = ({ children, innerProps, innerRef }) => {
|
193
|
-
return /* @__PURE__ */
|
206
|
+
return /* @__PURE__ */ React5.createElement(
|
194
207
|
"div",
|
195
208
|
{
|
196
209
|
ref: innerRef,
|
@@ -211,7 +224,7 @@ var Select = ({
|
|
211
224
|
...menuProps
|
212
225
|
}) => {
|
213
226
|
const menuOpen = menuProps.selectProps.menuIsOpen;
|
214
|
-
return /* @__PURE__ */
|
227
|
+
return /* @__PURE__ */ React5.createElement(
|
215
228
|
"div",
|
216
229
|
{
|
217
230
|
className: cn(
|
@@ -229,7 +242,7 @@ var Select = ({
|
|
229
242
|
let selectContainerStyles = "hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm";
|
230
243
|
let selectPlaceholderStyles = "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1";
|
231
244
|
let selectIndicatorContainerStyles = "hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ";
|
232
|
-
return /* @__PURE__ */
|
245
|
+
return /* @__PURE__ */ React5.createElement(
|
233
246
|
"div",
|
234
247
|
{
|
235
248
|
className: cn(
|
@@ -237,10 +250,10 @@ var Select = ({
|
|
237
250
|
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
238
251
|
)
|
239
252
|
},
|
240
|
-
props.label && /* @__PURE__ */
|
241
|
-
props.isLoading ? /* @__PURE__ */
|
253
|
+
props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label),
|
254
|
+
props.isLoading ? /* @__PURE__ */ React5.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
242
255
|
// TODO: enable keyboard to go to the next item in the list
|
243
|
-
/* @__PURE__ */
|
256
|
+
/* @__PURE__ */ React5.createElement(
|
244
257
|
ReactSelect,
|
245
258
|
{
|
246
259
|
noOptionsMessage: NoOption,
|
@@ -274,7 +287,7 @@ var Select = ({
|
|
274
287
|
// {...e}
|
275
288
|
// />
|
276
289
|
// ),
|
277
|
-
ValueContainer: (e) => /* @__PURE__ */
|
290
|
+
ValueContainer: (e) => /* @__PURE__ */ React5.createElement(
|
278
291
|
"div",
|
279
292
|
{
|
280
293
|
className: cn(
|
@@ -284,7 +297,7 @@ var Select = ({
|
|
284
297
|
...e
|
285
298
|
}
|
286
299
|
),
|
287
|
-
MultiValueContainer: (e) => /* @__PURE__ */
|
300
|
+
MultiValueContainer: (e) => /* @__PURE__ */ React5.createElement(
|
288
301
|
"div",
|
289
302
|
{
|
290
303
|
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
@@ -303,7 +316,7 @@ var Select = ({
|
|
303
316
|
isSearchable: props.isSearchable
|
304
317
|
}
|
305
318
|
)
|
306
|
-
) : /* @__PURE__ */
|
319
|
+
) : /* @__PURE__ */ React5.createElement(
|
307
320
|
CreatableSelect,
|
308
321
|
{
|
309
322
|
formatCreateLabel: (inputValue) => {
|
@@ -333,16 +346,7 @@ var Select = ({
|
|
333
346
|
onInputChange: (newValue, action) => props.onInputChange(newValue, action)
|
334
347
|
}
|
335
348
|
),
|
336
|
-
!props.hideHelperText && /* @__PURE__ */
|
337
|
-
"p",
|
338
|
-
{
|
339
|
-
className: cn(
|
340
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
341
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
342
|
-
)
|
343
|
-
},
|
344
|
-
props.helperText
|
345
|
-
)
|
349
|
+
!props.hideHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText })
|
346
350
|
);
|
347
351
|
};
|
348
352
|
export {
|