@sikka/hawa 0.46.3-next → 0.47.0-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Radio-Dyvlywnk.d.mts → Radio-BPHTeDMz.d.mts} +8 -7
- package/dist/{Radio-DlPwVCG4.d.ts → Radio-cRcIH8_L.d.ts} +8 -7
- package/dist/blocks/auth/index.d.mts +8 -8
- package/dist/blocks/auth/index.d.ts +8 -8
- package/dist/blocks/auth/index.js +87 -133
- package/dist/blocks/auth/index.mjs +21 -53
- package/dist/blocks/feedback/index.js +69 -80
- package/dist/blocks/feedback/index.mjs +5 -5
- package/dist/blocks/index.d.mts +3 -3
- package/dist/blocks/index.d.ts +3 -3
- package/dist/blocks/index.js +87 -133
- package/dist/blocks/index.mjs +6 -25
- package/dist/blocks/misc/index.js +70 -84
- package/dist/blocks/misc/index.mjs +5 -5
- package/dist/blocks/pricing/index.js +1 -1
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/{chunk-QLUJEUIB.mjs → chunk-342KIV4R.mjs} +83 -110
- package/dist/{chunk-EHJXQQDP.mjs → chunk-5S5DR7KF.mjs} +1 -1
- package/dist/{chunk-HJVL6X7I.mjs → chunk-6SJUUJOV.mjs} +1 -1
- package/dist/{chunk-7O555VJR.mjs → chunk-AWJSHOYU.mjs} +69 -80
- package/dist/{chunk-U72MOMEK.mjs → chunk-C2UOOH4X.mjs} +1 -1
- package/dist/{chunk-7L5VUKZ7.mjs → chunk-EOH6A3GR.mjs} +2 -5
- package/dist/{chunk-6UOJKVIA.mjs → chunk-IFWYR5W2.mjs} +1 -1
- package/dist/{chunk-YXUHXKKK.mjs → chunk-JP2N5WKD.mjs} +1 -1
- package/dist/{chunk-R37QEYSB.mjs → chunk-NMW4GM4G.mjs} +1 -1
- package/dist/{chunk-CIMTNOLA.mjs → chunk-WUMDFBEK.mjs} +1 -1
- package/dist/colorPicker/index.js +1 -1
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +1 -1
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +1 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/dataTable/index.js +2 -5
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +2 -5
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +2 -2
- package/dist/elements/index.d.ts +2 -2
- package/dist/elements/index.js +83 -110
- package/dist/elements/index.mjs +3 -3
- package/dist/index.d.mts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +87 -133
- package/dist/index.mjs +87 -133
- package/dist/input/index.js +2 -5
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +2 -5
- package/dist/input/index.mjs.map +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/index.mjs +2 -2
- package/dist/passwordInput/index.js +2 -5
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +2 -5
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.d.mts +7 -7
- package/dist/phoneInput/index.d.ts +7 -7
- package/dist/phoneInput/index.js +79 -86
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +79 -86
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.js +3 -20
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +3 -20
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/select/index.d.mts +1 -0
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +69 -80
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +69 -80
- package/dist/select/index.mjs.map +1 -1
- package/dist/simpleTable/index.js +1 -1
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs +1 -1
- package/dist/simpleTable/index.mjs.map +1 -1
- package/dist/skeleton/index.js +1 -1
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs +1 -1
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/stats/index.js +1 -1
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs +1 -1
- package/dist/stats/index.mjs.map +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +1 -1
- package/dist/textarea/index.mjs.map +1 -1
- package/package.json +1 -1
@@ -1,17 +1,17 @@
|
|
1
1
|
"use client";
|
2
2
|
import {
|
3
3
|
Input
|
4
|
-
} from "../../chunk-
|
4
|
+
} from "../../chunk-EOH6A3GR.mjs";
|
5
5
|
import {
|
6
6
|
Chip,
|
7
7
|
ScrollArea
|
8
|
-
} from "../../chunk-
|
8
|
+
} from "../../chunk-C2UOOH4X.mjs";
|
9
9
|
import {
|
10
10
|
Textarea
|
11
|
-
} from "../../chunk-
|
11
|
+
} from "../../chunk-5S5DR7KF.mjs";
|
12
12
|
import {
|
13
13
|
Select
|
14
|
-
} from "../../chunk-
|
14
|
+
} from "../../chunk-AWJSHOYU.mjs";
|
15
15
|
import {
|
16
16
|
Button,
|
17
17
|
Card,
|
@@ -21,7 +21,7 @@ import {
|
|
21
21
|
CardHeader,
|
22
22
|
CardTitle,
|
23
23
|
cn
|
24
|
-
} from "../../chunk-
|
24
|
+
} from "../../chunk-IFWYR5W2.mjs";
|
25
25
|
|
26
26
|
// blocks/misc/LegalTexts.tsx
|
27
27
|
import React10 from "react";
|
@@ -2,22 +2,22 @@
|
|
2
2
|
import {
|
3
3
|
Chip,
|
4
4
|
ScrollArea
|
5
|
-
} from "../../chunk-
|
5
|
+
} from "../../chunk-C2UOOH4X.mjs";
|
6
6
|
import "../../chunk-47APBDKK.mjs";
|
7
7
|
import {
|
8
8
|
Radio
|
9
|
-
} from "../../chunk-
|
9
|
+
} from "../../chunk-NMW4GM4G.mjs";
|
10
10
|
import {
|
11
11
|
CheckMark,
|
12
12
|
UncheckMark
|
13
|
-
} from "../../chunk-
|
13
|
+
} from "../../chunk-JP2N5WKD.mjs";
|
14
14
|
import {
|
15
15
|
Button,
|
16
16
|
Card,
|
17
17
|
Skeleton,
|
18
18
|
Tooltip,
|
19
19
|
cn
|
20
|
-
} from "../../chunk-
|
20
|
+
} from "../../chunk-IFWYR5W2.mjs";
|
21
21
|
|
22
22
|
// blocks/pricing/PricingPlans.tsx
|
23
23
|
import React8 from "react";
|
@@ -9,7 +9,7 @@ import {
|
|
9
9
|
Label,
|
10
10
|
Skeleton,
|
11
11
|
cn
|
12
|
-
} from "./chunk-
|
12
|
+
} from "./chunk-6SJUUJOV.mjs";
|
13
13
|
|
14
14
|
// elements/alert/Alert.tsx
|
15
15
|
import React, { useRef, useState, useEffect } from "react";
|
@@ -215,14 +215,11 @@ var Input = forwardRef(
|
|
215
215
|
}
|
216
216
|
if (props.onChange) {
|
217
217
|
if (props.type === "number" && props.maxLength) {
|
218
|
-
console.log("type is ", props.type);
|
219
|
-
console.log("max length is ", props.maxLength);
|
220
218
|
let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
|
221
219
|
const newEvent = { ...e, target: { ...e.target, value: v } };
|
222
220
|
setValue(v);
|
223
221
|
props.onChange(newEvent);
|
224
222
|
} else {
|
225
|
-
console.log("NETIHERRRER");
|
226
223
|
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
227
224
|
setValue(newValue);
|
228
225
|
props.onChange(newEvent);
|
@@ -247,7 +244,7 @@ var Input = forwardRef(
|
|
247
244
|
)
|
248
245
|
},
|
249
246
|
props.label && /* @__PURE__ */ React2.createElement(Label, { ...labelProps }, props.label),
|
250
|
-
/* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React2.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React2.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React2.createElement(Skeleton, {
|
247
|
+
/* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React2.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React2.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React2.createElement(Skeleton, { as: "input" })) : props.isLoadingError ? /* @__PURE__ */ React2.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React2.createElement(
|
251
248
|
Skeleton,
|
252
249
|
{
|
253
250
|
animation: "none",
|
@@ -353,6 +350,7 @@ import clsx from "clsx";
|
|
353
350
|
var Select = ({
|
354
351
|
labelProps,
|
355
352
|
labelKey = "label",
|
353
|
+
valueKey = "value",
|
356
354
|
...props
|
357
355
|
}) => {
|
358
356
|
const NoOption = () => {
|
@@ -372,13 +370,7 @@ var Select = ({
|
|
372
370
|
children
|
373
371
|
);
|
374
372
|
};
|
375
|
-
const Option = ({
|
376
|
-
children,
|
377
|
-
innerProps,
|
378
|
-
innerRef,
|
379
|
-
isFocused,
|
380
|
-
isSelected
|
381
|
-
}) => {
|
373
|
+
const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
|
382
374
|
return /* @__PURE__ */ React3.createElement(
|
383
375
|
"div",
|
384
376
|
{
|
@@ -393,14 +385,7 @@ var Select = ({
|
|
393
385
|
children
|
394
386
|
);
|
395
387
|
};
|
396
|
-
const Menu = ({
|
397
|
-
cx,
|
398
|
-
children,
|
399
|
-
getStyles,
|
400
|
-
innerProps,
|
401
|
-
innerRef,
|
402
|
-
...menuProps
|
403
|
-
}) => {
|
388
|
+
const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
|
404
389
|
const menuOpen = menuProps.selectProps.menuIsOpen;
|
405
390
|
return /* @__PURE__ */ React3.createElement(
|
406
391
|
"div",
|
@@ -429,71 +414,72 @@ var Select = ({
|
|
429
414
|
)
|
430
415
|
},
|
431
416
|
props.label && /* @__PURE__ */ React3.createElement(Label, { ...labelProps }, props.label),
|
432
|
-
props.isLoading ? /* @__PURE__ */ React3.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
{
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
459
|
-
props.disabled && "hawa-opacity-30"
|
460
|
-
)
|
461
|
-
},
|
462
|
-
unstyled: true,
|
463
|
-
autoFocus: false,
|
464
|
-
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
|
417
|
+
props.isLoading ? /* @__PURE__ */ React3.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ React3.createElement(
|
418
|
+
ReactSelect,
|
419
|
+
{
|
420
|
+
noOptionsMessage: NoOption,
|
421
|
+
classNames: {
|
422
|
+
control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
|
423
|
+
container: () => cn(
|
424
|
+
selectContainerStyles,
|
425
|
+
props.phoneCode && phoneCodeStyles,
|
426
|
+
props.isMulti && "hawa-ps-0 "
|
427
|
+
),
|
428
|
+
placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
|
429
|
+
valueContainer: () => "hawa-text-foreground hawa-px-1",
|
430
|
+
singleValue: () => cn(
|
431
|
+
props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
|
432
|
+
),
|
433
|
+
indicatorsContainer: () => cn(
|
434
|
+
selectIndicatorContainerStyles,
|
435
|
+
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
436
|
+
props.disabled && "hawa-opacity-30"
|
437
|
+
)
|
438
|
+
},
|
439
|
+
unstyled: true,
|
440
|
+
autoFocus: false,
|
441
|
+
components: props.hideIndicator ? {
|
442
|
+
Option: (optionProps) => /* @__PURE__ */ React3.createElement(
|
465
443
|
Option,
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
className
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
444
|
+
{
|
445
|
+
...optionProps,
|
446
|
+
isSelected: optionProps.data[valueKey] === props.value[valueKey]
|
447
|
+
}
|
448
|
+
),
|
449
|
+
Menu,
|
450
|
+
IndicatorsContainer: () => null
|
451
|
+
} : {
|
452
|
+
Option,
|
453
|
+
Menu,
|
454
|
+
ValueContainer: (e) => /* @__PURE__ */ React3.createElement(
|
455
|
+
"div",
|
456
|
+
{
|
457
|
+
className: cn(
|
458
|
+
e.className,
|
459
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
|
460
|
+
),
|
461
|
+
...e
|
462
|
+
}
|
463
|
+
),
|
464
|
+
MultiValueContainer: (e) => /* @__PURE__ */ React3.createElement(
|
465
|
+
"div",
|
466
|
+
{
|
467
|
+
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
468
|
+
...e
|
469
|
+
}
|
470
|
+
)
|
471
|
+
},
|
472
|
+
onChange: (newValue, action) => props.onChange(newValue, action),
|
473
|
+
options: props.options,
|
474
|
+
getOptionLabel: props.getOptionLabel,
|
475
|
+
defaultValue: props.defaultValue,
|
476
|
+
value: props.value,
|
477
|
+
placeholder: props.placeholder,
|
478
|
+
isDisabled: props.disabled,
|
479
|
+
isClearable: props.isClearable,
|
480
|
+
isMulti: props.isMulti,
|
481
|
+
isSearchable: props.isSearchable
|
482
|
+
}
|
497
483
|
) : /* @__PURE__ */ React3.createElement(
|
498
484
|
CreatableSelect,
|
499
485
|
{
|
@@ -2231,11 +2217,13 @@ var PhoneInput = ({
|
|
2231
2217
|
countryCodes,
|
2232
2218
|
...props
|
2233
2219
|
}) => {
|
2220
|
+
var _a;
|
2234
2221
|
const [phoneNumber, setPhoneNumber] = useState3("");
|
2235
|
-
const [countryCode, setCountryCode] = useState3(
|
2222
|
+
const [countryCode, setCountryCode] = useState3(
|
2223
|
+
props.preferredCountry || { label: "+966" }
|
2224
|
+
);
|
2236
2225
|
const inputRef = useRef2(null);
|
2237
2226
|
const handleInputChange = (e) => {
|
2238
|
-
console.log("test e ", e.target.value);
|
2239
2227
|
const validChars = /^[0-9-()]+$/;
|
2240
2228
|
const input = e.target.value;
|
2241
2229
|
if (input === "" || validChars.test(input)) {
|
@@ -2257,11 +2245,13 @@ var PhoneInput = ({
|
|
2257
2245
|
isMulti: false,
|
2258
2246
|
isSearchable: true,
|
2259
2247
|
isClearable: false,
|
2260
|
-
placeholder:
|
2248
|
+
placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
|
2261
2249
|
options: countryCodes || countries_default,
|
2262
|
-
onChange: setCountryCode,
|
2263
|
-
|
2264
|
-
|
2250
|
+
onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
|
2251
|
+
valueKey: "label",
|
2252
|
+
labelKey: "label",
|
2253
|
+
value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
|
2254
|
+
defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
|
2265
2255
|
}
|
2266
2256
|
), /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React4.createElement(
|
2267
2257
|
"input",
|
@@ -2519,14 +2509,7 @@ var PinInputRoot = React7.forwardRef(({ className, containerClassName, ...props
|
|
2519
2509
|
}
|
2520
2510
|
));
|
2521
2511
|
PinInputRoot.displayName = "PinInputRoot";
|
2522
|
-
var PinInputGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
2523
|
-
"div",
|
2524
|
-
{
|
2525
|
-
ref,
|
2526
|
-
className: cn("hawa-flex hawa-items-center", className),
|
2527
|
-
...props
|
2528
|
-
}
|
2529
|
-
));
|
2512
|
+
var PinInputGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
|
2530
2513
|
PinInputGroup.displayName = "PinInputGroup";
|
2531
2514
|
var PinInputSlot = React7.forwardRef(({ index, className, ...props }, ref) => {
|
2532
2515
|
const pinInputContext = React7.useContext(OTPInputContext);
|
@@ -2549,22 +2532,12 @@ var PinInputSlot = React7.forwardRef(({ index, className, ...props }, ref) => {
|
|
2549
2532
|
PinInputSlot.displayName = "PinInputSlot";
|
2550
2533
|
var PinInputSeperator = React7.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React7.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React7.createElement(Dot, null)));
|
2551
2534
|
PinInputSeperator.displayName = "PinInputSeperator";
|
2552
|
-
var PinInput = ({
|
2553
|
-
separatorPosition = 0,
|
2554
|
-
...props
|
2555
|
-
}) => {
|
2535
|
+
var PinInput = ({ separatorPosition = 0, ...props }) => {
|
2556
2536
|
const maxLength = props.maxLength || 6;
|
2557
2537
|
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
2558
2538
|
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
2559
2539
|
const secondGroupLength = maxLength - firstGroupLength;
|
2560
|
-
return /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React7.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(
|
2561
|
-
PinInputSlot,
|
2562
|
-
{
|
2563
|
-
key: index,
|
2564
|
-
index,
|
2565
|
-
className: "hawa-w-full hawa-border"
|
2566
|
-
}
|
2567
|
-
))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React7.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(
|
2540
|
+
return /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React7.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React7.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(
|
2568
2541
|
PinInputSlot,
|
2569
2542
|
{
|
2570
2543
|
key: index + firstGroupLength,
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
Label,
|
5
5
|
Skeleton,
|
6
6
|
cn
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-IFWYR5W2.mjs";
|
8
8
|
|
9
9
|
// elements/select/Select.tsx
|
10
10
|
import React from "react";
|
@@ -14,6 +14,7 @@ import clsx from "clsx";
|
|
14
14
|
var Select = ({
|
15
15
|
labelProps,
|
16
16
|
labelKey = "label",
|
17
|
+
valueKey = "value",
|
17
18
|
...props
|
18
19
|
}) => {
|
19
20
|
const NoOption = () => {
|
@@ -33,13 +34,7 @@ var Select = ({
|
|
33
34
|
children
|
34
35
|
);
|
35
36
|
};
|
36
|
-
const Option = ({
|
37
|
-
children,
|
38
|
-
innerProps,
|
39
|
-
innerRef,
|
40
|
-
isFocused,
|
41
|
-
isSelected
|
42
|
-
}) => {
|
37
|
+
const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
|
43
38
|
return /* @__PURE__ */ React.createElement(
|
44
39
|
"div",
|
45
40
|
{
|
@@ -54,14 +49,7 @@ var Select = ({
|
|
54
49
|
children
|
55
50
|
);
|
56
51
|
};
|
57
|
-
const Menu = ({
|
58
|
-
cx,
|
59
|
-
children,
|
60
|
-
getStyles,
|
61
|
-
innerProps,
|
62
|
-
innerRef,
|
63
|
-
...menuProps
|
64
|
-
}) => {
|
52
|
+
const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
|
65
53
|
const menuOpen = menuProps.selectProps.menuIsOpen;
|
66
54
|
return /* @__PURE__ */ React.createElement(
|
67
55
|
"div",
|
@@ -90,71 +78,72 @@ var Select = ({
|
|
90
78
|
)
|
91
79
|
},
|
92
80
|
props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
|
93
|
-
props.isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
{
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
120
|
-
props.disabled && "hawa-opacity-30"
|
121
|
-
)
|
122
|
-
},
|
123
|
-
unstyled: true,
|
124
|
-
autoFocus: false,
|
125
|
-
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
|
81
|
+
props.isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ React.createElement(
|
82
|
+
ReactSelect,
|
83
|
+
{
|
84
|
+
noOptionsMessage: NoOption,
|
85
|
+
classNames: {
|
86
|
+
control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
|
87
|
+
container: () => cn(
|
88
|
+
selectContainerStyles,
|
89
|
+
props.phoneCode && phoneCodeStyles,
|
90
|
+
props.isMulti && "hawa-ps-0 "
|
91
|
+
),
|
92
|
+
placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
|
93
|
+
valueContainer: () => "hawa-text-foreground hawa-px-1",
|
94
|
+
singleValue: () => cn(
|
95
|
+
props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
|
96
|
+
),
|
97
|
+
indicatorsContainer: () => cn(
|
98
|
+
selectIndicatorContainerStyles,
|
99
|
+
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
100
|
+
props.disabled && "hawa-opacity-30"
|
101
|
+
)
|
102
|
+
},
|
103
|
+
unstyled: true,
|
104
|
+
autoFocus: false,
|
105
|
+
components: props.hideIndicator ? {
|
106
|
+
Option: (optionProps) => /* @__PURE__ */ React.createElement(
|
126
107
|
Option,
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
className
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
108
|
+
{
|
109
|
+
...optionProps,
|
110
|
+
isSelected: optionProps.data[valueKey] === props.value[valueKey]
|
111
|
+
}
|
112
|
+
),
|
113
|
+
Menu,
|
114
|
+
IndicatorsContainer: () => null
|
115
|
+
} : {
|
116
|
+
Option,
|
117
|
+
Menu,
|
118
|
+
ValueContainer: (e) => /* @__PURE__ */ React.createElement(
|
119
|
+
"div",
|
120
|
+
{
|
121
|
+
className: cn(
|
122
|
+
e.className,
|
123
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
|
124
|
+
),
|
125
|
+
...e
|
126
|
+
}
|
127
|
+
),
|
128
|
+
MultiValueContainer: (e) => /* @__PURE__ */ React.createElement(
|
129
|
+
"div",
|
130
|
+
{
|
131
|
+
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
132
|
+
...e
|
133
|
+
}
|
134
|
+
)
|
135
|
+
},
|
136
|
+
onChange: (newValue, action) => props.onChange(newValue, action),
|
137
|
+
options: props.options,
|
138
|
+
getOptionLabel: props.getOptionLabel,
|
139
|
+
defaultValue: props.defaultValue,
|
140
|
+
value: props.value,
|
141
|
+
placeholder: props.placeholder,
|
142
|
+
isDisabled: props.disabled,
|
143
|
+
isClearable: props.isClearable,
|
144
|
+
isMulti: props.isMulti,
|
145
|
+
isSearchable: props.isSearchable
|
146
|
+
}
|
158
147
|
) : /* @__PURE__ */ React.createElement(
|
159
148
|
CreatableSelect,
|
160
149
|
{
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
Label,
|
5
5
|
Skeleton,
|
6
6
|
cn
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-IFWYR5W2.mjs";
|
8
8
|
|
9
9
|
// elements/input/Input.tsx
|
10
10
|
import React, { forwardRef, useState } from "react";
|
@@ -51,14 +51,11 @@ var Input = forwardRef(
|
|
51
51
|
}
|
52
52
|
if (props.onChange) {
|
53
53
|
if (props.type === "number" && props.maxLength) {
|
54
|
-
console.log("type is ", props.type);
|
55
|
-
console.log("max length is ", props.maxLength);
|
56
54
|
let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
|
57
55
|
const newEvent = { ...e, target: { ...e.target, value: v } };
|
58
56
|
setValue(v);
|
59
57
|
props.onChange(newEvent);
|
60
58
|
} else {
|
61
|
-
console.log("NETIHERRRER");
|
62
59
|
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
63
60
|
setValue(newValue);
|
64
61
|
props.onChange(newEvent);
|
@@ -83,7 +80,7 @@ var Input = forwardRef(
|
|
83
80
|
)
|
84
81
|
},
|
85
82
|
props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
|
86
|
-
/* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(Skeleton, {
|
83
|
+
/* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(Skeleton, { as: "input" })) : props.isLoadingError ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(
|
87
84
|
Skeleton,
|
88
85
|
{
|
89
86
|
animation: "none",
|