@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
package/dist/blocks/index.js
CHANGED
@@ -1423,7 +1423,7 @@ function Skeleton({
|
|
1423
1423
|
};
|
1424
1424
|
const styledAs = {
|
1425
1425
|
div: "",
|
1426
|
-
input: "
|
1426
|
+
input: "hawa-h-[40px] hawa-w-full"
|
1427
1427
|
};
|
1428
1428
|
return /* @__PURE__ */ import_react7.default.createElement(
|
1429
1429
|
"div",
|
@@ -1485,14 +1485,11 @@ var Input = (0, import_react8.forwardRef)(
|
|
1485
1485
|
}
|
1486
1486
|
if (props.onChange) {
|
1487
1487
|
if (props.type === "number" && props.maxLength) {
|
1488
|
-
console.log("type is ", props.type);
|
1489
|
-
console.log("max length is ", props.maxLength);
|
1490
1488
|
let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
|
1491
1489
|
const newEvent = { ...e, target: { ...e.target, value: v } };
|
1492
1490
|
setValue(v);
|
1493
1491
|
props.onChange(newEvent);
|
1494
1492
|
} else {
|
1495
|
-
console.log("NETIHERRRER");
|
1496
1493
|
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
1497
1494
|
setValue(newValue);
|
1498
1495
|
props.onChange(newEvent);
|
@@ -1517,7 +1514,7 @@ var Input = (0, import_react8.forwardRef)(
|
|
1517
1514
|
)
|
1518
1515
|
},
|
1519
1516
|
props.label && /* @__PURE__ */ import_react8.default.createElement(Label, { ...labelProps }, props.label),
|
1520
|
-
/* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react8.default.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(Skeleton, {
|
1517
|
+
/* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react8.default.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(Skeleton, { as: "input" })) : props.isLoadingError ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(
|
1521
1518
|
Skeleton,
|
1522
1519
|
{
|
1523
1520
|
animation: "none",
|
@@ -3319,6 +3316,7 @@ var import_clsx2 = __toESM(require("clsx"));
|
|
3319
3316
|
var Select = ({
|
3320
3317
|
labelProps,
|
3321
3318
|
labelKey = "label",
|
3319
|
+
valueKey = "value",
|
3322
3320
|
...props
|
3323
3321
|
}) => {
|
3324
3322
|
const NoOption = () => {
|
@@ -3338,13 +3336,7 @@ var Select = ({
|
|
3338
3336
|
children
|
3339
3337
|
);
|
3340
3338
|
};
|
3341
|
-
const Option = ({
|
3342
|
-
children,
|
3343
|
-
innerProps,
|
3344
|
-
innerRef,
|
3345
|
-
isFocused,
|
3346
|
-
isSelected
|
3347
|
-
}) => {
|
3339
|
+
const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
|
3348
3340
|
return /* @__PURE__ */ import_react9.default.createElement(
|
3349
3341
|
"div",
|
3350
3342
|
{
|
@@ -3359,14 +3351,7 @@ var Select = ({
|
|
3359
3351
|
children
|
3360
3352
|
);
|
3361
3353
|
};
|
3362
|
-
const Menu = ({
|
3363
|
-
cx,
|
3364
|
-
children,
|
3365
|
-
getStyles,
|
3366
|
-
innerProps,
|
3367
|
-
innerRef,
|
3368
|
-
...menuProps
|
3369
|
-
}) => {
|
3354
|
+
const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
|
3370
3355
|
const menuOpen = menuProps.selectProps.menuIsOpen;
|
3371
3356
|
return /* @__PURE__ */ import_react9.default.createElement(
|
3372
3357
|
"div",
|
@@ -3395,71 +3380,72 @@ var Select = ({
|
|
3395
3380
|
)
|
3396
3381
|
},
|
3397
3382
|
props.label && /* @__PURE__ */ import_react9.default.createElement(Label, { ...labelProps }, props.label),
|
3398
|
-
props.isLoading ? /* @__PURE__ */ import_react9.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
3399
|
-
|
3400
|
-
|
3401
|
-
|
3402
|
-
{
|
3403
|
-
|
3404
|
-
|
3405
|
-
|
3406
|
-
|
3407
|
-
|
3408
|
-
|
3409
|
-
|
3410
|
-
|
3411
|
-
|
3412
|
-
|
3413
|
-
|
3414
|
-
|
3415
|
-
|
3416
|
-
|
3417
|
-
|
3418
|
-
|
3419
|
-
|
3420
|
-
|
3421
|
-
|
3422
|
-
|
3423
|
-
|
3424
|
-
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
3425
|
-
props.disabled && "hawa-opacity-30"
|
3426
|
-
)
|
3427
|
-
},
|
3428
|
-
unstyled: true,
|
3429
|
-
autoFocus: false,
|
3430
|
-
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
|
3383
|
+
props.isLoading ? /* @__PURE__ */ import_react9.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ import_react9.default.createElement(
|
3384
|
+
import_react_select.default,
|
3385
|
+
{
|
3386
|
+
noOptionsMessage: NoOption,
|
3387
|
+
classNames: {
|
3388
|
+
control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
|
3389
|
+
container: () => cn(
|
3390
|
+
selectContainerStyles,
|
3391
|
+
props.phoneCode && phoneCodeStyles,
|
3392
|
+
props.isMulti && "hawa-ps-0 "
|
3393
|
+
),
|
3394
|
+
placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
|
3395
|
+
valueContainer: () => "hawa-text-foreground hawa-px-1",
|
3396
|
+
singleValue: () => cn(
|
3397
|
+
props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
|
3398
|
+
),
|
3399
|
+
indicatorsContainer: () => cn(
|
3400
|
+
selectIndicatorContainerStyles,
|
3401
|
+
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
3402
|
+
props.disabled && "hawa-opacity-30"
|
3403
|
+
)
|
3404
|
+
},
|
3405
|
+
unstyled: true,
|
3406
|
+
autoFocus: false,
|
3407
|
+
components: props.hideIndicator ? {
|
3408
|
+
Option: (optionProps) => /* @__PURE__ */ import_react9.default.createElement(
|
3431
3409
|
Option,
|
3432
|
-
|
3433
|
-
|
3434
|
-
|
3435
|
-
|
3436
|
-
|
3437
|
-
|
3438
|
-
|
3439
|
-
|
3440
|
-
|
3441
|
-
|
3442
|
-
|
3443
|
-
|
3444
|
-
|
3445
|
-
|
3446
|
-
className
|
3447
|
-
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3451
|
-
|
3452
|
-
|
3453
|
-
|
3454
|
-
|
3455
|
-
|
3456
|
-
|
3457
|
-
|
3458
|
-
|
3459
|
-
|
3460
|
-
|
3461
|
-
|
3462
|
-
|
3410
|
+
{
|
3411
|
+
...optionProps,
|
3412
|
+
isSelected: optionProps.data[valueKey] === props.value[valueKey]
|
3413
|
+
}
|
3414
|
+
),
|
3415
|
+
Menu,
|
3416
|
+
IndicatorsContainer: () => null
|
3417
|
+
} : {
|
3418
|
+
Option,
|
3419
|
+
Menu,
|
3420
|
+
ValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
|
3421
|
+
"div",
|
3422
|
+
{
|
3423
|
+
className: cn(
|
3424
|
+
e.className,
|
3425
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
|
3426
|
+
),
|
3427
|
+
...e
|
3428
|
+
}
|
3429
|
+
),
|
3430
|
+
MultiValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
|
3431
|
+
"div",
|
3432
|
+
{
|
3433
|
+
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
3434
|
+
...e
|
3435
|
+
}
|
3436
|
+
)
|
3437
|
+
},
|
3438
|
+
onChange: (newValue, action) => props.onChange(newValue, action),
|
3439
|
+
options: props.options,
|
3440
|
+
getOptionLabel: props.getOptionLabel,
|
3441
|
+
defaultValue: props.defaultValue,
|
3442
|
+
value: props.value,
|
3443
|
+
placeholder: props.placeholder,
|
3444
|
+
isDisabled: props.disabled,
|
3445
|
+
isClearable: props.isClearable,
|
3446
|
+
isMulti: props.isMulti,
|
3447
|
+
isSearchable: props.isSearchable
|
3448
|
+
}
|
3463
3449
|
) : /* @__PURE__ */ import_react9.default.createElement(
|
3464
3450
|
import_creatable.default,
|
3465
3451
|
{
|
@@ -3501,11 +3487,13 @@ var PhoneInput = ({
|
|
3501
3487
|
countryCodes,
|
3502
3488
|
...props
|
3503
3489
|
}) => {
|
3490
|
+
var _a;
|
3504
3491
|
const [phoneNumber, setPhoneNumber] = (0, import_react10.useState)("");
|
3505
|
-
const [countryCode, setCountryCode] = (0, import_react10.useState)(
|
3492
|
+
const [countryCode, setCountryCode] = (0, import_react10.useState)(
|
3493
|
+
props.preferredCountry || { label: "+966" }
|
3494
|
+
);
|
3506
3495
|
const inputRef = (0, import_react10.useRef)(null);
|
3507
3496
|
const handleInputChange = (e) => {
|
3508
|
-
console.log("test e ", e.target.value);
|
3509
3497
|
const validChars = /^[0-9-()]+$/;
|
3510
3498
|
const input = e.target.value;
|
3511
3499
|
if (input === "" || validChars.test(input)) {
|
@@ -3527,11 +3515,13 @@ var PhoneInput = ({
|
|
3527
3515
|
isMulti: false,
|
3528
3516
|
isSearchable: true,
|
3529
3517
|
isClearable: false,
|
3530
|
-
placeholder:
|
3518
|
+
placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
|
3531
3519
|
options: countryCodes || countries_default,
|
3532
|
-
onChange: setCountryCode,
|
3533
|
-
|
3534
|
-
|
3520
|
+
onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
|
3521
|
+
valueKey: "label",
|
3522
|
+
labelKey: "label",
|
3523
|
+
value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
|
3524
|
+
defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
|
3535
3525
|
}
|
3536
3526
|
), /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ import_react10.default.createElement(
|
3537
3527
|
"input",
|
@@ -4020,14 +4010,7 @@ var LoginForm = ({
|
|
4020
4010
|
(texts == null ? void 0 : texts.loginText) || "Login"
|
4021
4011
|
),
|
4022
4012
|
props.additionalButtons && props.additionalButtons,
|
4023
|
-
props.allowRegister && /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ import_react14.default.createElement(
|
4024
|
-
"span",
|
4025
|
-
{
|
4026
|
-
onClick: props.onRouteToRegister,
|
4027
|
-
className: "clickable-link"
|
4028
|
-
},
|
4029
|
-
(texts == null ? void 0 : texts.createAccount) || "Create Account"
|
4030
|
-
))
|
4013
|
+
props.allowRegister && /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ import_react14.default.createElement("span", { onClick: props.onRouteToRegister, className: "clickable-link" }, (texts == null ? void 0 : texts.createAccount) || "Create Account"))
|
4031
4014
|
)),
|
4032
4015
|
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react14.default.createElement(
|
4033
4016
|
CardFooter,
|
@@ -4939,14 +4922,7 @@ var PinInputRoot = React25.forwardRef(({ className, containerClassName, ...props
|
|
4939
4922
|
}
|
4940
4923
|
));
|
4941
4924
|
PinInputRoot.displayName = "PinInputRoot";
|
4942
|
-
var PinInputGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
4943
|
-
"div",
|
4944
|
-
{
|
4945
|
-
ref,
|
4946
|
-
className: cn("hawa-flex hawa-items-center", className),
|
4947
|
-
...props
|
4948
|
-
}
|
4949
|
-
));
|
4925
|
+
var PinInputGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
|
4950
4926
|
PinInputGroup.displayName = "PinInputGroup";
|
4951
4927
|
var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
|
4952
4928
|
const pinInputContext = React25.useContext(import_input_otp.OTPInputContext);
|
@@ -4969,22 +4945,12 @@ var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
|
|
4969
4945
|
PinInputSlot.displayName = "PinInputSlot";
|
4970
4946
|
var PinInputSeperator = React25.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React25.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React25.createElement(Dot, null)));
|
4971
4947
|
PinInputSeperator.displayName = "PinInputSeperator";
|
4972
|
-
var PinInput = ({
|
4973
|
-
separatorPosition = 0,
|
4974
|
-
...props
|
4975
|
-
}) => {
|
4948
|
+
var PinInput = ({ separatorPosition = 0, ...props }) => {
|
4976
4949
|
const maxLength = props.maxLength || 6;
|
4977
4950
|
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
4978
4951
|
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
4979
4952
|
const secondGroupLength = maxLength - firstGroupLength;
|
4980
|
-
return /* @__PURE__ */ React25.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React25.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
|
4981
|
-
PinInputSlot,
|
4982
|
-
{
|
4983
|
-
key: index,
|
4984
|
-
index,
|
4985
|
-
className: "hawa-w-full hawa-border"
|
4986
|
-
}
|
4987
|
-
))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React25.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
|
4953
|
+
return /* @__PURE__ */ React25.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React25.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React25.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
|
4988
4954
|
PinInputSlot,
|
4989
4955
|
{
|
4990
4956
|
key: index + firstGroupLength,
|
@@ -4995,10 +4961,7 @@ var PinInput = ({
|
|
4995
4961
|
};
|
4996
4962
|
|
4997
4963
|
// blocks/auth/CodeConfirmation.tsx
|
4998
|
-
var CodeConfirmation = ({
|
4999
|
-
codeLength = 6,
|
5000
|
-
...props
|
5001
|
-
}) => {
|
4964
|
+
var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
5002
4965
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
5003
4966
|
const formSchema = z5.object({
|
5004
4967
|
otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(codeLength, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
|
@@ -5037,14 +5000,7 @@ var CodeConfirmation = ({
|
|
5037
5000
|
}
|
5038
5001
|
};
|
5039
5002
|
}, []);
|
5040
|
-
return /* @__PURE__ */ import_react24.default.createElement(Card, null, /* @__PURE__ */ import_react24.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react24.default.createElement(
|
5041
|
-
Alert,
|
5042
|
-
{
|
5043
|
-
title: props.errorTitle,
|
5044
|
-
text: props.errorText,
|
5045
|
-
severity: "error"
|
5046
|
-
}
|
5047
|
-
), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react24.default.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ import_react24.default.createElement(
|
5003
|
+
return /* @__PURE__ */ import_react24.default.createElement(Card, null, /* @__PURE__ */ import_react24.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react24.default.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react24.default.createElement("span", null, props.identifier))), /* @__PURE__ */ import_react24.default.createElement(
|
5048
5004
|
"form",
|
5049
5005
|
{
|
5050
5006
|
noValidate: true,
|
@@ -5093,9 +5049,7 @@ var CodeConfirmation = ({
|
|
5093
5049
|
if (props.onCancel) {
|
5094
5050
|
return props.onCancel();
|
5095
5051
|
} else {
|
5096
|
-
console.log(
|
5097
|
-
"Cancel button clicked but onCancel prop is missing"
|
5098
|
-
);
|
5052
|
+
console.log("Cancel button clicked but onCancel prop is missing");
|
5099
5053
|
}
|
5100
5054
|
},
|
5101
5055
|
variant: "outline"
|
package/dist/blocks/index.mjs
CHANGED
@@ -17,7 +17,7 @@ import {
|
|
17
17
|
TabsList,
|
18
18
|
TabsTrigger,
|
19
19
|
Textarea
|
20
|
-
} from "../chunk-
|
20
|
+
} from "../chunk-342KIV4R.mjs";
|
21
21
|
import {
|
22
22
|
getHotkeyHandler
|
23
23
|
} from "../chunk-WL7C2A5D.mjs";
|
@@ -44,7 +44,7 @@ import {
|
|
44
44
|
VeryBadEmoji,
|
45
45
|
VeryGoodEmoji,
|
46
46
|
cn
|
47
|
-
} from "../chunk-
|
47
|
+
} from "../chunk-6SJUUJOV.mjs";
|
48
48
|
import "../chunk-2LUXOXAL.mjs";
|
49
49
|
|
50
50
|
// blocks/auth/AuthButtons.tsx
|
@@ -450,14 +450,7 @@ var LoginForm = ({
|
|
450
450
|
(texts == null ? void 0 : texts.loginText) || "Login"
|
451
451
|
),
|
452
452
|
props.additionalButtons && props.additionalButtons,
|
453
|
-
props.allowRegister && /* @__PURE__ */ React2.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React2.createElement(
|
454
|
-
"span",
|
455
|
-
{
|
456
|
-
onClick: props.onRouteToRegister,
|
457
|
-
className: "clickable-link"
|
458
|
-
},
|
459
|
-
(texts == null ? void 0 : texts.createAccount) || "Create Account"
|
460
|
-
))
|
453
|
+
props.allowRegister && /* @__PURE__ */ React2.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React2.createElement("span", { onClick: props.onRouteToRegister, className: "clickable-link" }, (texts == null ? void 0 : texts.createAccount) || "Create Account"))
|
461
454
|
)),
|
462
455
|
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React2.createElement(
|
463
456
|
CardFooter,
|
@@ -1127,10 +1120,7 @@ import React8, { useEffect, useState as useState3 } from "react";
|
|
1127
1120
|
import { Controller as Controller5, useForm as useForm5 } from "react-hook-form";
|
1128
1121
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
1129
1122
|
import * as z5 from "zod";
|
1130
|
-
var CodeConfirmation = ({
|
1131
|
-
codeLength = 6,
|
1132
|
-
...props
|
1133
|
-
}) => {
|
1123
|
+
var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
1134
1124
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
1135
1125
|
const formSchema = z5.object({
|
1136
1126
|
otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(codeLength, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
|
@@ -1169,14 +1159,7 @@ var CodeConfirmation = ({
|
|
1169
1159
|
}
|
1170
1160
|
};
|
1171
1161
|
}, []);
|
1172
|
-
return /* @__PURE__ */ React8.createElement(Card, null, /* @__PURE__ */ React8.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React8.createElement(
|
1173
|
-
Alert,
|
1174
|
-
{
|
1175
|
-
title: props.errorTitle,
|
1176
|
-
text: props.errorText,
|
1177
|
-
severity: "error"
|
1178
|
-
}
|
1179
|
-
), /* @__PURE__ */ React8.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ React8.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ React8.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ React8.createElement(
|
1162
|
+
return /* @__PURE__ */ React8.createElement(Card, null, /* @__PURE__ */ React8.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React8.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ React8.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ React8.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ React8.createElement("span", null, props.identifier))), /* @__PURE__ */ React8.createElement(
|
1180
1163
|
"form",
|
1181
1164
|
{
|
1182
1165
|
noValidate: true,
|
@@ -1225,9 +1208,7 @@ var CodeConfirmation = ({
|
|
1225
1208
|
if (props.onCancel) {
|
1226
1209
|
return props.onCancel();
|
1227
1210
|
} else {
|
1228
|
-
console.log(
|
1229
|
-
"Cancel button clicked but onCancel prop is missing"
|
1230
|
-
);
|
1211
|
+
console.log("Cancel button clicked but onCancel prop is missing");
|
1231
1212
|
}
|
1232
1213
|
},
|
1233
1214
|
variant: "outline"
|
@@ -1211,7 +1211,7 @@ function Skeleton({
|
|
1211
1211
|
};
|
1212
1212
|
const styledAs = {
|
1213
1213
|
div: "",
|
1214
|
-
input: "
|
1214
|
+
input: "hawa-h-[40px] hawa-w-full"
|
1215
1215
|
};
|
1216
1216
|
return /* @__PURE__ */ import_react27.default.createElement(
|
1217
1217
|
"div",
|
@@ -1273,14 +1273,11 @@ var Input = (0, import_react28.forwardRef)(
|
|
1273
1273
|
}
|
1274
1274
|
if (props.onChange) {
|
1275
1275
|
if (props.type === "number" && props.maxLength) {
|
1276
|
-
console.log("type is ", props.type);
|
1277
|
-
console.log("max length is ", props.maxLength);
|
1278
1276
|
let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
|
1279
1277
|
const newEvent = { ...e, target: { ...e.target, value: v } };
|
1280
1278
|
setValue(v);
|
1281
1279
|
props.onChange(newEvent);
|
1282
1280
|
} else {
|
1283
|
-
console.log("NETIHERRRER");
|
1284
1281
|
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
1285
1282
|
setValue(newValue);
|
1286
1283
|
props.onChange(newEvent);
|
@@ -1305,7 +1302,7 @@ var Input = (0, import_react28.forwardRef)(
|
|
1305
1302
|
)
|
1306
1303
|
},
|
1307
1304
|
props.label && /* @__PURE__ */ import_react28.default.createElement(Label, { ...labelProps }, props.label),
|
1308
|
-
/* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react28.default.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react28.default.createElement(Skeleton, {
|
1305
|
+
/* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react28.default.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react28.default.createElement(Skeleton, { as: "input" })) : props.isLoadingError ? /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react28.default.createElement(
|
1309
1306
|
Skeleton,
|
1310
1307
|
{
|
1311
1308
|
animation: "none",
|
@@ -1502,6 +1499,7 @@ var import_clsx2 = __toESM(require("clsx"));
|
|
1502
1499
|
var Select = ({
|
1503
1500
|
labelProps,
|
1504
1501
|
labelKey = "label",
|
1502
|
+
valueKey = "value",
|
1505
1503
|
...props
|
1506
1504
|
}) => {
|
1507
1505
|
const NoOption = () => {
|
@@ -1521,13 +1519,7 @@ var Select = ({
|
|
1521
1519
|
children
|
1522
1520
|
);
|
1523
1521
|
};
|
1524
|
-
const Option = ({
|
1525
|
-
children,
|
1526
|
-
innerProps,
|
1527
|
-
innerRef,
|
1528
|
-
isFocused,
|
1529
|
-
isSelected
|
1530
|
-
}) => {
|
1522
|
+
const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
|
1531
1523
|
return /* @__PURE__ */ import_react33.default.createElement(
|
1532
1524
|
"div",
|
1533
1525
|
{
|
@@ -1542,14 +1534,7 @@ var Select = ({
|
|
1542
1534
|
children
|
1543
1535
|
);
|
1544
1536
|
};
|
1545
|
-
const Menu = ({
|
1546
|
-
cx,
|
1547
|
-
children,
|
1548
|
-
getStyles,
|
1549
|
-
innerProps,
|
1550
|
-
innerRef,
|
1551
|
-
...menuProps
|
1552
|
-
}) => {
|
1537
|
+
const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
|
1553
1538
|
const menuOpen = menuProps.selectProps.menuIsOpen;
|
1554
1539
|
return /* @__PURE__ */ import_react33.default.createElement(
|
1555
1540
|
"div",
|
@@ -1578,71 +1563,72 @@ var Select = ({
|
|
1578
1563
|
)
|
1579
1564
|
},
|
1580
1565
|
props.label && /* @__PURE__ */ import_react33.default.createElement(Label, { ...labelProps }, props.label),
|
1581
|
-
props.isLoading ? /* @__PURE__ */ import_react33.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
{
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
1608
|
-
props.disabled && "hawa-opacity-30"
|
1609
|
-
)
|
1610
|
-
},
|
1611
|
-
unstyled: true,
|
1612
|
-
autoFocus: false,
|
1613
|
-
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
|
1566
|
+
props.isLoading ? /* @__PURE__ */ import_react33.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ import_react33.default.createElement(
|
1567
|
+
import_react_select.default,
|
1568
|
+
{
|
1569
|
+
noOptionsMessage: NoOption,
|
1570
|
+
classNames: {
|
1571
|
+
control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
|
1572
|
+
container: () => cn(
|
1573
|
+
selectContainerStyles,
|
1574
|
+
props.phoneCode && phoneCodeStyles,
|
1575
|
+
props.isMulti && "hawa-ps-0 "
|
1576
|
+
),
|
1577
|
+
placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
|
1578
|
+
valueContainer: () => "hawa-text-foreground hawa-px-1",
|
1579
|
+
singleValue: () => cn(
|
1580
|
+
props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
|
1581
|
+
),
|
1582
|
+
indicatorsContainer: () => cn(
|
1583
|
+
selectIndicatorContainerStyles,
|
1584
|
+
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
1585
|
+
props.disabled && "hawa-opacity-30"
|
1586
|
+
)
|
1587
|
+
},
|
1588
|
+
unstyled: true,
|
1589
|
+
autoFocus: false,
|
1590
|
+
components: props.hideIndicator ? {
|
1591
|
+
Option: (optionProps) => /* @__PURE__ */ import_react33.default.createElement(
|
1614
1592
|
Option,
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
className
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1593
|
+
{
|
1594
|
+
...optionProps,
|
1595
|
+
isSelected: optionProps.data[valueKey] === props.value[valueKey]
|
1596
|
+
}
|
1597
|
+
),
|
1598
|
+
Menu,
|
1599
|
+
IndicatorsContainer: () => null
|
1600
|
+
} : {
|
1601
|
+
Option,
|
1602
|
+
Menu,
|
1603
|
+
ValueContainer: (e) => /* @__PURE__ */ import_react33.default.createElement(
|
1604
|
+
"div",
|
1605
|
+
{
|
1606
|
+
className: cn(
|
1607
|
+
e.className,
|
1608
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
|
1609
|
+
),
|
1610
|
+
...e
|
1611
|
+
}
|
1612
|
+
),
|
1613
|
+
MultiValueContainer: (e) => /* @__PURE__ */ import_react33.default.createElement(
|
1614
|
+
"div",
|
1615
|
+
{
|
1616
|
+
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
1617
|
+
...e
|
1618
|
+
}
|
1619
|
+
)
|
1620
|
+
},
|
1621
|
+
onChange: (newValue, action) => props.onChange(newValue, action),
|
1622
|
+
options: props.options,
|
1623
|
+
getOptionLabel: props.getOptionLabel,
|
1624
|
+
defaultValue: props.defaultValue,
|
1625
|
+
value: props.value,
|
1626
|
+
placeholder: props.placeholder,
|
1627
|
+
isDisabled: props.disabled,
|
1628
|
+
isClearable: props.isClearable,
|
1629
|
+
isMulti: props.isMulti,
|
1630
|
+
isSearchable: props.isSearchable
|
1631
|
+
}
|
1646
1632
|
) : /* @__PURE__ */ import_react33.default.createElement(
|
1647
1633
|
import_creatable.default,
|
1648
1634
|
{
|