@sikka/hawa 0.47.0-next → 0.48.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/blocks/auth/index.d.mts +26 -9
- package/dist/blocks/auth/index.d.ts +26 -9
- package/dist/blocks/auth/index.js +926 -305
- package/dist/blocks/auth/index.mjs +409 -247
- package/dist/blocks/feedback/index.d.mts +1 -1
- package/dist/blocks/feedback/index.d.ts +1 -1
- package/dist/blocks/index.d.mts +25 -8
- package/dist/blocks/index.d.ts +25 -8
- package/dist/blocks/index.js +2264 -2114
- package/dist/blocks/index.mjs +403 -246
- package/dist/blocks/misc/index.d.mts +1 -1
- package/dist/blocks/misc/index.d.ts +1 -1
- package/dist/blocks/misc/index.mjs +49 -366
- package/dist/blocks/pricing/index.d.mts +1 -1
- package/dist/blocks/pricing/index.d.ts +1 -1
- package/dist/blocks/pricing/index.mjs +1 -1
- package/dist/{chunk-342KIV4R.mjs → chunk-GBLWUEYN.mjs} +471 -471
- package/dist/chunk-JFWD2ICY.mjs +511 -0
- package/dist/elements/index.mjs +1 -1
- package/dist/index.css +7 -0
- package/dist/index.d.mts +26 -8
- package/dist/index.d.ts +26 -8
- package/dist/index.js +397 -245
- package/dist/index.mjs +402 -245
- package/dist/{textTypes-DXLtO2fL.d.mts → textTypes-CYQYIsFt.d.mts} +1 -0
- package/dist/{textTypes-DXLtO2fL.d.ts → textTypes-CYQYIsFt.d.ts} +1 -0
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunk-EOH6A3GR.mjs +0 -183
@@ -3883,9 +3883,10 @@ var LoginForm = ({
|
|
3883
3883
|
};
|
3884
3884
|
|
3885
3885
|
// blocks/auth/RegisterForm.tsx
|
3886
|
-
var
|
3886
|
+
var import_react37 = __toESM(require("react"));
|
3887
3887
|
var import_react_hook_form2 = require("react-hook-form");
|
3888
3888
|
var import_zod2 = require("@hookform/resolvers/zod");
|
3889
|
+
var import_libphonenumber_js2 = require("libphonenumber-js");
|
3889
3890
|
var z2 = __toESM(require("zod"));
|
3890
3891
|
|
3891
3892
|
// elements/checkbox/Checkbox.tsx
|
@@ -4033,6 +4034,475 @@ var StopPropagationWrapper = (props) => {
|
|
4033
4034
|
return /* @__PURE__ */ import_react16.default.createElement("div", { onClick: handleClick }, props.children);
|
4034
4035
|
};
|
4035
4036
|
|
4037
|
+
// elements/tabs/Tabs.tsx
|
4038
|
+
var React30 = __toESM(require("react"));
|
4039
|
+
|
4040
|
+
// hooks/useIsomorphicEffect.ts
|
4041
|
+
var import_react17 = require("react");
|
4042
|
+
|
4043
|
+
// hooks/useDiscloser.ts
|
4044
|
+
var import_react18 = require("react");
|
4045
|
+
|
4046
|
+
// hooks/useHover.ts
|
4047
|
+
var import_react19 = require("react");
|
4048
|
+
|
4049
|
+
// hooks/useToast.ts
|
4050
|
+
var React22 = __toESM(require("react"));
|
4051
|
+
|
4052
|
+
// hooks/useCarousel.ts
|
4053
|
+
var import_react20 = require("react");
|
4054
|
+
|
4055
|
+
// hooks/useDialogCarousel.ts
|
4056
|
+
var import_react21 = require("react");
|
4057
|
+
var import_embla_carousel_auto_height = __toESM(require("embla-carousel-auto-height"));
|
4058
|
+
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
4059
|
+
|
4060
|
+
// hooks/useDialogSteps.ts
|
4061
|
+
var import_react22 = require("react");
|
4062
|
+
|
4063
|
+
// hooks/useClipboard.ts
|
4064
|
+
var import_react23 = require("react");
|
4065
|
+
|
4066
|
+
// hooks/useBreakpoint.ts
|
4067
|
+
var import_react24 = require("react");
|
4068
|
+
|
4069
|
+
// hooks/useWindowSize.ts
|
4070
|
+
var import_react25 = require("react");
|
4071
|
+
|
4072
|
+
// hooks/useFocusWithin.ts
|
4073
|
+
var import_react26 = require("react");
|
4074
|
+
|
4075
|
+
// hooks/useMediaQuery.ts
|
4076
|
+
var import_react27 = require("react");
|
4077
|
+
|
4078
|
+
// hooks/useScrollPosition.ts
|
4079
|
+
var import_react28 = require("react");
|
4080
|
+
|
4081
|
+
// hooks/useTable.ts
|
4082
|
+
var import_react29 = require("react");
|
4083
|
+
|
4084
|
+
// hooks/useTabs.ts
|
4085
|
+
var import_react30 = require("react");
|
4086
|
+
|
4087
|
+
// hooks/useMeasureDirty.ts
|
4088
|
+
var import_react31 = require("react");
|
4089
|
+
|
4090
|
+
// hooks/useClickOutside.ts
|
4091
|
+
var import_react32 = require("react");
|
4092
|
+
|
4093
|
+
// hooks/useShortcuts.ts
|
4094
|
+
var import_react33 = require("react");
|
4095
|
+
|
4096
|
+
// hooks/useWindowEvent.ts
|
4097
|
+
var import_react34 = require("react");
|
4098
|
+
function useWindowEvent(type, listener, options) {
|
4099
|
+
(0, import_react34.useEffect)(() => {
|
4100
|
+
window.addEventListener(type, listener, options);
|
4101
|
+
return () => window.removeEventListener(type, listener, options);
|
4102
|
+
}, [type, listener]);
|
4103
|
+
}
|
4104
|
+
|
4105
|
+
// hooks/useViewportSize.ts
|
4106
|
+
var import_react35 = require("react");
|
4107
|
+
var eventListerOptions = {
|
4108
|
+
passive: true
|
4109
|
+
};
|
4110
|
+
function useViewportSize() {
|
4111
|
+
const [windowSize, setWindowSize] = (0, import_react35.useState)({
|
4112
|
+
width: 0,
|
4113
|
+
height: 0
|
4114
|
+
});
|
4115
|
+
const setSize = (0, import_react35.useCallback)(() => {
|
4116
|
+
setWindowSize({
|
4117
|
+
width: window.innerWidth || 0,
|
4118
|
+
height: window.innerHeight || 0
|
4119
|
+
});
|
4120
|
+
}, []);
|
4121
|
+
useWindowEvent("resize", setSize, eventListerOptions);
|
4122
|
+
useWindowEvent("orientationchange", setSize, eventListerOptions);
|
4123
|
+
(0, import_react35.useEffect)(setSize, []);
|
4124
|
+
return windowSize;
|
4125
|
+
}
|
4126
|
+
|
4127
|
+
// elements/tabs/Tabs.tsx
|
4128
|
+
var Popover = __toESM(require("@radix-ui/react-popover"));
|
4129
|
+
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"));
|
4130
|
+
var import_tailwind_variants = require("tailwind-variants");
|
4131
|
+
|
4132
|
+
// elements/chip/Chip.tsx
|
4133
|
+
var import_react36 = __toESM(require("react"));
|
4134
|
+
var Chip = import_react36.default.forwardRef(
|
4135
|
+
({
|
4136
|
+
label,
|
4137
|
+
size = "normal",
|
4138
|
+
icon,
|
4139
|
+
color,
|
4140
|
+
radius = "inherit",
|
4141
|
+
dot,
|
4142
|
+
dotStatus = "none",
|
4143
|
+
...rest
|
4144
|
+
}, ref) => {
|
4145
|
+
let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
|
4146
|
+
let radiusStyles = {
|
4147
|
+
inherit: " hawa-rounded",
|
4148
|
+
full: "hawa-rounded-full",
|
4149
|
+
none: "hawa-rounded-none"
|
4150
|
+
};
|
4151
|
+
let sizeStyles = {
|
4152
|
+
small: "hawa-h-[15px] hawa-leading-4 hawa-px-0 hawa-py-0 hawa-text-[9px] hawa-gap-0.5 ",
|
4153
|
+
normal: "hawa-h-fit hawa-text-xs",
|
4154
|
+
large: "hawa-text-base"
|
4155
|
+
};
|
4156
|
+
let dotStyles = {
|
4157
|
+
small: "hawa-flex hawa-h-1 hawa-w-1 hawa-rounded-full",
|
4158
|
+
normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
|
4159
|
+
large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
|
4160
|
+
};
|
4161
|
+
let dotStatusStyles = {
|
4162
|
+
none: "hawa-bg-gray-500 dark:hawa-bg-gray-800",
|
4163
|
+
available: "hawa-bg-green-500",
|
4164
|
+
unavailable: "hawa-bg-red-500"
|
4165
|
+
};
|
4166
|
+
let colorStyles = {
|
4167
|
+
green: "hawa-bg-green-200 hawa-text-green-700 dark:hawa-bg-green-700 dark:hawa-text-green-200",
|
4168
|
+
blue: "hawa-bg-blue-200 hawa-text-blue-700 dark:hawa-bg-blue-700 dark:hawa-text-blue-100",
|
4169
|
+
red: "hawa-bg-red-200 hawa-text-red-700 dark:hawa-bg-red-700 dark:hawa-text-red-100",
|
4170
|
+
yellow: "hawa-bg-yellow-200 hawa-text-yellow-700 dark:hawa-bg-yellow-600 dark:hawa-text-black",
|
4171
|
+
orange: "hawa-bg-orange-200 hawa-text-orange-700 dark:hawa-bg-orange-700 dark:hawa-text-orange-100",
|
4172
|
+
purple: "hawa-bg-purple-200 hawa-text-purple-700 dark:hawa-bg-purple-700 dark:hawa-text-purple-100",
|
4173
|
+
cyan: "hawa-bg-cyan-200 hawa-text-cyan-700 dark:hawa-bg-cyan-700 dark:hawa-text-cyan-100",
|
4174
|
+
hyper: "hawa-text-white dark:hawa-text-black hawa-bg-gradient-to-tl hawa-from-pink-500 hawa-via-red-500 hawa-to-yellow-500 ",
|
4175
|
+
oceanic: "hawa-text-white dark:hawa-text-black hawa-bg-gradient-to-bl hawa-from-green-300 hawa-via-blue-500 hawa-to-purple-600"
|
4176
|
+
};
|
4177
|
+
if (label) {
|
4178
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
4179
|
+
"span",
|
4180
|
+
{
|
4181
|
+
...rest,
|
4182
|
+
ref,
|
4183
|
+
className: cn(
|
4184
|
+
defaultStyles,
|
4185
|
+
sizeStyles[size],
|
4186
|
+
radiusStyles[radius],
|
4187
|
+
color ? colorStyles[color] : "hawa-border hawa-bg-none",
|
4188
|
+
rest.className
|
4189
|
+
)
|
4190
|
+
},
|
4191
|
+
dot && /* @__PURE__ */ import_react36.default.createElement(
|
4192
|
+
"span",
|
4193
|
+
{
|
4194
|
+
className: cn(dotStyles[size], dotStatusStyles[dotStatus])
|
4195
|
+
}
|
4196
|
+
),
|
4197
|
+
icon && icon,
|
4198
|
+
label
|
4199
|
+
);
|
4200
|
+
} else {
|
4201
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
4202
|
+
"span",
|
4203
|
+
{
|
4204
|
+
...rest,
|
4205
|
+
ref,
|
4206
|
+
className: cn(
|
4207
|
+
"hawa-h-2 hawa-w-2 hawa-rounded-full",
|
4208
|
+
color ? colorStyles[color] : "hawa-border hawa-bg-none"
|
4209
|
+
)
|
4210
|
+
}
|
4211
|
+
);
|
4212
|
+
}
|
4213
|
+
}
|
4214
|
+
);
|
4215
|
+
|
4216
|
+
// elements/scrollArea/ScrollArea.tsx
|
4217
|
+
var React29 = __toESM(require("react"));
|
4218
|
+
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
|
4219
|
+
var ScrollArea = React29.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
|
4220
|
+
const scrollAreaRef = React29.useRef(null);
|
4221
|
+
const isDragging = React29.useRef(false);
|
4222
|
+
const startPos = React29.useRef({ x: 0, y: 0 });
|
4223
|
+
const scrollPos = React29.useRef({ top: 0, left: 0 });
|
4224
|
+
const [showLeftFade, setShowLeftFade] = React29.useState(false);
|
4225
|
+
const [showRightFade, setShowRightFade] = React29.useState(false);
|
4226
|
+
const checkOverflow = () => {
|
4227
|
+
if (scrollAreaRef.current) {
|
4228
|
+
const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;
|
4229
|
+
setShowLeftFade(scrollLeft > 0);
|
4230
|
+
setShowRightFade(scrollLeft + clientWidth < scrollWidth);
|
4231
|
+
}
|
4232
|
+
};
|
4233
|
+
const onMouseDown = (e) => {
|
4234
|
+
isDragging.current = true;
|
4235
|
+
startPos.current = { x: e.clientX, y: e.clientY };
|
4236
|
+
if (scrollAreaRef.current) {
|
4237
|
+
scrollPos.current = {
|
4238
|
+
top: scrollAreaRef.current.scrollTop,
|
4239
|
+
left: scrollAreaRef.current.scrollLeft
|
4240
|
+
};
|
4241
|
+
}
|
4242
|
+
document.addEventListener("mousemove", onMouseMove);
|
4243
|
+
document.addEventListener("mouseup", onMouseUp);
|
4244
|
+
};
|
4245
|
+
const onMouseMove = (e) => {
|
4246
|
+
if (!isDragging.current || !scrollAreaRef.current) return;
|
4247
|
+
const dx = e.clientX - startPos.current.x;
|
4248
|
+
const dy = e.clientY - startPos.current.y;
|
4249
|
+
if (orientation === "vertical") {
|
4250
|
+
scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;
|
4251
|
+
} else {
|
4252
|
+
scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;
|
4253
|
+
checkOverflow();
|
4254
|
+
}
|
4255
|
+
};
|
4256
|
+
const onMouseUp = () => {
|
4257
|
+
isDragging.current = false;
|
4258
|
+
document.removeEventListener("mousemove", onMouseMove);
|
4259
|
+
document.removeEventListener("mouseup", onMouseUp);
|
4260
|
+
};
|
4261
|
+
React29.useEffect(() => {
|
4262
|
+
checkOverflow();
|
4263
|
+
if (scrollAreaRef.current) {
|
4264
|
+
scrollAreaRef.current.addEventListener("scroll", checkOverflow);
|
4265
|
+
window.addEventListener("resize", checkOverflow);
|
4266
|
+
}
|
4267
|
+
return () => {
|
4268
|
+
if (scrollAreaRef.current) {
|
4269
|
+
scrollAreaRef.current.removeEventListener("scroll", checkOverflow);
|
4270
|
+
}
|
4271
|
+
window.removeEventListener("resize", checkOverflow);
|
4272
|
+
};
|
4273
|
+
}, []);
|
4274
|
+
return /* @__PURE__ */ React29.createElement(
|
4275
|
+
ScrollAreaPrimitive.Root,
|
4276
|
+
{
|
4277
|
+
ref,
|
4278
|
+
className: cn("hawa-relative hawa-overflow-hidden", className),
|
4279
|
+
...props
|
4280
|
+
},
|
4281
|
+
/* @__PURE__ */ React29.createElement(
|
4282
|
+
"div",
|
4283
|
+
{
|
4284
|
+
className: cn(
|
4285
|
+
"hawa-pointer-events-none hawa-absolute hawa-bg-background hawa-h-full hawa-w-[50px] hawa-z-10 hawa-start-0 hawa-mask-fade-right",
|
4286
|
+
showLeftFade ? "hawa-block" : "hawa-hidden"
|
4287
|
+
)
|
4288
|
+
}
|
4289
|
+
),
|
4290
|
+
/* @__PURE__ */ React29.createElement(
|
4291
|
+
"div",
|
4292
|
+
{
|
4293
|
+
className: cn(
|
4294
|
+
"hawa-pointer-events-none hawa-absolute hawa-bg-background hawa-mask-fade-left hawa-end-0 hawa-h-full hawa-w-[50px] hawa-z-10",
|
4295
|
+
showRightFade ? "hawa-block" : "hawa-hidden"
|
4296
|
+
)
|
4297
|
+
}
|
4298
|
+
),
|
4299
|
+
/* @__PURE__ */ React29.createElement(
|
4300
|
+
ScrollAreaPrimitive.Viewport,
|
4301
|
+
{
|
4302
|
+
ref: scrollAreaRef,
|
4303
|
+
className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]",
|
4304
|
+
onMouseDown
|
4305
|
+
},
|
4306
|
+
children
|
4307
|
+
),
|
4308
|
+
/* @__PURE__ */ React29.createElement(ScrollBar, { orientation }),
|
4309
|
+
/* @__PURE__ */ React29.createElement(ScrollAreaPrimitive.Corner, null)
|
4310
|
+
);
|
4311
|
+
});
|
4312
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
4313
|
+
var ScrollBar = React29.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React29.createElement(
|
4314
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
4315
|
+
{
|
4316
|
+
ref,
|
4317
|
+
orientation,
|
4318
|
+
className: cn(
|
4319
|
+
"hawa-flex hawa-touch-none hawa-select-none hawa-transition-colors",
|
4320
|
+
orientation === "vertical" && "hawa-h-full hawa-w-2.5 hawa-border-l hawa-border-l-transparent hawa-p-[1px]",
|
4321
|
+
orientation === "horizontal" && "hawa-h-2.5 hawa-border-t hawa-border-t-transparent hawa-p-[1px]",
|
4322
|
+
className
|
4323
|
+
),
|
4324
|
+
...props
|
4325
|
+
},
|
4326
|
+
/* @__PURE__ */ React29.createElement(
|
4327
|
+
ScrollAreaPrimitive.ScrollAreaThumb,
|
4328
|
+
{
|
4329
|
+
className: cn(
|
4330
|
+
"hawa-relative hawa-rounded-full hawa-bg-border",
|
4331
|
+
orientation === "vertical" && "hawa-flex-1"
|
4332
|
+
)
|
4333
|
+
}
|
4334
|
+
)
|
4335
|
+
));
|
4336
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
4337
|
+
|
4338
|
+
// elements/tabs/Tabs.tsx
|
4339
|
+
var tabsListVariant = (0, import_tailwind_variants.tv)({
|
4340
|
+
base: "",
|
4341
|
+
variants: {
|
4342
|
+
variant: {
|
4343
|
+
default: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-rounded hawa-border hawa-bg-muted hawa-p-1 hawa-text-muted-foreground dark:hawa-border-primary/10",
|
4344
|
+
underlined: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-rounded hawa-p-1 hawa-text-muted-foreground dark:hawa-border-primary/10",
|
4345
|
+
underlined_tabs: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-text-muted-foreground"
|
4346
|
+
},
|
4347
|
+
orientation: { horizontal: "", vertical: "" }
|
4348
|
+
},
|
4349
|
+
compoundVariants: [
|
4350
|
+
{
|
4351
|
+
variant: "underlined_tabs",
|
4352
|
+
orientation: "vertical",
|
4353
|
+
class: "hawa-border-e-2 hawa-border-e-primary"
|
4354
|
+
},
|
4355
|
+
{
|
4356
|
+
variant: "underlined_tabs",
|
4357
|
+
orientation: "horizontal",
|
4358
|
+
class: "hawa-border-b-2 hawa-border-b-primary"
|
4359
|
+
}
|
4360
|
+
],
|
4361
|
+
defaultVariants: { variant: "default", orientation: "horizontal" }
|
4362
|
+
});
|
4363
|
+
var tabsTriggerVariant = (0, import_tailwind_variants.tv)({
|
4364
|
+
base: "",
|
4365
|
+
variants: {
|
4366
|
+
variant: {
|
4367
|
+
default: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-border hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50 data-[state=active]:hawa-bg-primary data-[state=active]:hawa-text-primary-foreground data-[state=active]:hawa-shadow-sm dark:hawa-border-primary/10",
|
4368
|
+
underlined: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-rounded-none hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
|
4369
|
+
underlined_tabs: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50 hawa-bg-primary/10 data-[state=active]:hawa-bg-primary data-[state=active]:hawa-text-primary-foreground dark:hawa-border-primary/10"
|
4370
|
+
},
|
4371
|
+
orientation: { horizontal: "", vertical: "" }
|
4372
|
+
},
|
4373
|
+
compoundVariants: [
|
4374
|
+
{
|
4375
|
+
variant: "underlined",
|
4376
|
+
orientation: "horizontal",
|
4377
|
+
class: "data-[state=active]:hawa-border-b-primary hawa-border-b hawa-border-b-2"
|
4378
|
+
},
|
4379
|
+
{
|
4380
|
+
variant: "underlined",
|
4381
|
+
orientation: "vertical",
|
4382
|
+
class: "data-[state=active]:hawa-border-e-primary hawa-border-e hawa-border-e-2"
|
4383
|
+
},
|
4384
|
+
{
|
4385
|
+
variant: "underlined_tabs",
|
4386
|
+
orientation: "horizontal",
|
4387
|
+
class: "hawa-rounded-b-none"
|
4388
|
+
},
|
4389
|
+
{
|
4390
|
+
variant: "underlined_tabs",
|
4391
|
+
orientation: "vertical",
|
4392
|
+
class: "hawa-rounded-e-none"
|
4393
|
+
}
|
4394
|
+
],
|
4395
|
+
defaultVariants: { variant: "default", orientation: "horizontal" }
|
4396
|
+
});
|
4397
|
+
var TabsContext = React30.createContext({ orientation: "horizontal", variant: "default", scrollable: false });
|
4398
|
+
var Tabs = React30.forwardRef(
|
4399
|
+
({ className, orientation, scrollable, variant = "default", ...props }, ref) => /* @__PURE__ */ React30.createElement(
|
4400
|
+
TabsPrimitive.Root,
|
4401
|
+
{
|
4402
|
+
ref,
|
4403
|
+
className: cn(
|
4404
|
+
"hawa-flex hawa-gap-2",
|
4405
|
+
orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
|
4406
|
+
className
|
4407
|
+
),
|
4408
|
+
...props
|
4409
|
+
},
|
4410
|
+
/* @__PURE__ */ React30.createElement(TabsContext.Provider, { value: { orientation, variant, scrollable } }, props.children)
|
4411
|
+
)
|
4412
|
+
);
|
4413
|
+
var TabsList = React30.forwardRef(({ className, classNames, ...props }, ref) => {
|
4414
|
+
const { orientation, variant, scrollable } = React30.useContext(TabsContext);
|
4415
|
+
const { width } = useViewportSize();
|
4416
|
+
if (scrollable && width < 768 && orientation === "horizontal") {
|
4417
|
+
return /* @__PURE__ */ React30.createElement(ScrollArea, { orientation: "horizontal", className: classNames == null ? void 0 : classNames.scrollArea }, /* @__PURE__ */ React30.createElement(
|
4418
|
+
TabsPrimitive.List,
|
4419
|
+
{
|
4420
|
+
ref,
|
4421
|
+
className: cn(
|
4422
|
+
tabsListVariant({ variant, orientation }),
|
4423
|
+
"hawa-flex-row hawa-flex-nowrap",
|
4424
|
+
className
|
4425
|
+
),
|
4426
|
+
...props
|
4427
|
+
}
|
4428
|
+
));
|
4429
|
+
} else {
|
4430
|
+
return /* @__PURE__ */ React30.createElement(
|
4431
|
+
TabsPrimitive.List,
|
4432
|
+
{
|
4433
|
+
ref,
|
4434
|
+
className: cn(
|
4435
|
+
tabsListVariant({ variant, orientation }),
|
4436
|
+
orientation === "vertical" ? "hawa-flex-col" : "hawa-flex-row",
|
4437
|
+
"hawa-flex-wrap",
|
4438
|
+
className
|
4439
|
+
),
|
4440
|
+
...props
|
4441
|
+
}
|
4442
|
+
);
|
4443
|
+
}
|
4444
|
+
});
|
4445
|
+
var TabsTrigger = React30.forwardRef(
|
4446
|
+
({ className, chipProps, withPopover = false, onPopoverClick, ...props }, ref) => {
|
4447
|
+
const { orientation, variant } = React30.useContext(TabsContext);
|
4448
|
+
if (withPopover) {
|
4449
|
+
return /* @__PURE__ */ React30.createElement(Popover.Root, { open: props.showPopover }, /* @__PURE__ */ React30.createElement(Popover.Anchor, { asChild: true }, /* @__PURE__ */ React30.createElement(
|
4450
|
+
TabsPrimitive.Trigger,
|
4451
|
+
{
|
4452
|
+
className: cn(
|
4453
|
+
tabsTriggerVariant({ variant, orientation }),
|
4454
|
+
"hawa-relative",
|
4455
|
+
className
|
4456
|
+
),
|
4457
|
+
...props
|
4458
|
+
},
|
4459
|
+
props.children,
|
4460
|
+
chipProps && /* @__PURE__ */ React30.createElement(Chip, { ...chipProps })
|
4461
|
+
)), /* @__PURE__ */ React30.createElement(
|
4462
|
+
Popover.Content,
|
4463
|
+
{
|
4464
|
+
onClick: onPopoverClick,
|
4465
|
+
asChild: true,
|
4466
|
+
className: cn(
|
4467
|
+
"dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-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",
|
4468
|
+
"hawa-arrow-default-top hawa-mt-2"
|
4469
|
+
)
|
4470
|
+
},
|
4471
|
+
/* @__PURE__ */ React30.createElement("div", { className: "hawa-p-2" }, " ", props.popoverContent)
|
4472
|
+
));
|
4473
|
+
} else {
|
4474
|
+
return /* @__PURE__ */ React30.createElement(
|
4475
|
+
TabsPrimitive.Trigger,
|
4476
|
+
{
|
4477
|
+
className: cn(
|
4478
|
+
tabsTriggerVariant({ variant, orientation }),
|
4479
|
+
"hawa-relative",
|
4480
|
+
className
|
4481
|
+
),
|
4482
|
+
...props
|
4483
|
+
},
|
4484
|
+
props.children,
|
4485
|
+
chipProps && /* @__PURE__ */ React30.createElement(Chip, { ...chipProps })
|
4486
|
+
);
|
4487
|
+
}
|
4488
|
+
}
|
4489
|
+
);
|
4490
|
+
var TabsContent = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React30.createElement(
|
4491
|
+
TabsPrimitive.Content,
|
4492
|
+
{
|
4493
|
+
ref,
|
4494
|
+
className: cn(
|
4495
|
+
"hawa-ring-offset-hawa-background hawa-w-full focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2",
|
4496
|
+
className
|
4497
|
+
),
|
4498
|
+
...props
|
4499
|
+
}
|
4500
|
+
));
|
4501
|
+
Tabs.displayName = TabsPrimitive.Root.displayName;
|
4502
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
4503
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
4504
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
4505
|
+
|
4036
4506
|
// blocks/auth/RegisterForm.tsx
|
4037
4507
|
var RegisterForm = ({
|
4038
4508
|
texts,
|
@@ -4040,10 +4510,15 @@ var RegisterForm = ({
|
|
4040
4510
|
minPasswordLength = 8,
|
4041
4511
|
showTermsOption = false,
|
4042
4512
|
showNewsletterOption = false,
|
4513
|
+
registerTypes,
|
4043
4514
|
...props
|
4044
4515
|
}) => {
|
4045
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
4046
|
-
const [passwordVisible, setPasswordVisible] = (0,
|
4516
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
4517
|
+
const [passwordVisible, setPasswordVisible] = (0, import_react37.useState)(false);
|
4518
|
+
const [selectedRegisterType, setSelectedRegisterType] = (0, import_react37.useState)({
|
4519
|
+
value: ((_a = registerTypes == null ? void 0 : registerTypes[0]) == null ? void 0 : _a.value) || "password",
|
4520
|
+
label: ((_b = registerTypes == null ? void 0 : registerTypes[0]) == null ? void 0 : _b.label) || "Password"
|
4521
|
+
});
|
4047
4522
|
const thirdPartyAuthTexts = {
|
4048
4523
|
continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
|
4049
4524
|
continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
|
@@ -4055,8 +4530,12 @@ var RegisterForm = ({
|
|
4055
4530
|
};
|
4056
4531
|
const methods = (0, import_react_hook_form2.useForm)();
|
4057
4532
|
let fieldSchemas = {};
|
4533
|
+
const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
|
4534
|
+
if (hasPhoneType && selectedRegisterType.value === "phone") {
|
4535
|
+
registerFields = ["phone"];
|
4536
|
+
}
|
4058
4537
|
registerFields.forEach((field) => {
|
4059
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
4538
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
|
4060
4539
|
switch (field) {
|
4061
4540
|
case "fullname":
|
4062
4541
|
fieldSchemas["fullName"] = z2.string().optional();
|
@@ -4081,55 +4560,85 @@ var RegisterForm = ({
|
|
4081
4560
|
{ message: ((_g2 = texts == null ? void 0 : texts.username) == null ? void 0 : _g2.invalid) || "Invalid username" }
|
4082
4561
|
);
|
4083
4562
|
break;
|
4563
|
+
case "phone":
|
4564
|
+
fieldSchemas["phone"] = z2.string({
|
4565
|
+
required_error: ((_h2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _h2.required) || "Phone Number Required"
|
4566
|
+
}).refine(
|
4567
|
+
(value) => {
|
4568
|
+
let isPhoneValid = (0, import_libphonenumber_js2.isPossiblePhoneNumber)(value) && (0, import_libphonenumber_js2.isValidPhoneNumber)(value) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(value) === void 0;
|
4569
|
+
return isPhoneValid;
|
4570
|
+
},
|
4571
|
+
{ message: ((_i2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _i2.invalid) || "Phone Number Invalid" }
|
4572
|
+
);
|
4573
|
+
break;
|
4084
4574
|
}
|
4085
4575
|
});
|
4086
|
-
|
4087
|
-
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
4094
|
-
|
4095
|
-
|
4096
|
-
|
4097
|
-
|
4098
|
-
|
4099
|
-
|
4100
|
-
|
4101
|
-
|
4102
|
-
|
4103
|
-
|
4104
|
-
|
4105
|
-
|
4106
|
-
|
4107
|
-
|
4108
|
-
|
4109
|
-
|
4110
|
-
|
4111
|
-
|
4576
|
+
let formSchema;
|
4577
|
+
if (selectedRegisterType.value === "phone") {
|
4578
|
+
formSchema = z2.object({
|
4579
|
+
phone: z2.string({
|
4580
|
+
required_error: ((_c = texts == null ? void 0 : texts.phone) == null ? void 0 : _c.required) || "Phone Number Required"
|
4581
|
+
}).refine(
|
4582
|
+
(value) => {
|
4583
|
+
let isPhoneValid = (0, import_libphonenumber_js2.isPossiblePhoneNumber)(value) && (0, import_libphonenumber_js2.isValidPhoneNumber)(value) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(value) === void 0;
|
4584
|
+
return isPhoneValid;
|
4585
|
+
},
|
4586
|
+
{ message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
|
4587
|
+
),
|
4588
|
+
refCode: z2.string().optional(),
|
4589
|
+
reference: z2.string().optional(),
|
4590
|
+
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
4591
|
+
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
4592
|
+
}),
|
4593
|
+
newsletter_accepted: z2.boolean().optional()
|
4594
|
+
});
|
4595
|
+
} else {
|
4596
|
+
formSchema = z2.object({
|
4597
|
+
...fieldSchemas,
|
4598
|
+
password: z2.string({
|
4599
|
+
required_error: ((_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required) || "Password is required"
|
4600
|
+
}).min(minPasswordLength, {
|
4601
|
+
message: ((_f = texts == null ? void 0 : texts.password) == null ? void 0 : _f.tooShort) || "Password is too short"
|
4602
|
+
}).refine((value) => value !== "", {
|
4603
|
+
message: ((_g = texts == null ? void 0 : texts.password) == null ? void 0 : _g.required) || "Password is required"
|
4604
|
+
}),
|
4605
|
+
confirm_password: z2.string({
|
4606
|
+
required_error: ((_h = texts == null ? void 0 : texts.confirm) == null ? void 0 : _h.required) || "Confirm password required"
|
4607
|
+
}).min(minPasswordLength, {
|
4608
|
+
message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
|
4609
|
+
}).refine((value) => value !== "", {
|
4610
|
+
message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
|
4611
|
+
}),
|
4612
|
+
refCode: z2.string().optional(),
|
4613
|
+
reference: z2.string().optional(),
|
4614
|
+
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
4615
|
+
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
4616
|
+
}),
|
4617
|
+
newsletter_accepted: z2.boolean().optional()
|
4618
|
+
}).refine((data) => data.password === data.confirm_password, {
|
4619
|
+
message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
|
4620
|
+
path: ["confirm_password"]
|
4621
|
+
});
|
4622
|
+
}
|
4112
4623
|
const { handleSubmit, control, formState } = (0, import_react_hook_form2.useForm)({
|
4113
4624
|
resolver: (0, import_zod2.zodResolver)(formSchema)
|
4114
4625
|
});
|
4115
|
-
return /* @__PURE__ */
|
4116
|
-
|
4626
|
+
return /* @__PURE__ */ import_react37.default.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ import_react37.default.createElement(
|
4627
|
+
Card,
|
4117
4628
|
{
|
4629
|
+
dir: props.direction,
|
4118
4630
|
className: cn(
|
4119
|
-
|
4120
|
-
|
4631
|
+
(_m = props.classNames) == null ? void 0 : _m.card,
|
4632
|
+
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
4121
4633
|
)
|
4122
4634
|
},
|
4123
|
-
/* @__PURE__ */
|
4124
|
-
|
4635
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4636
|
+
CardContent,
|
4125
4637
|
{
|
4126
|
-
|
4127
|
-
|
4128
|
-
(_i = props.classNames) == null ? void 0 : _i.card,
|
4129
|
-
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
4130
|
-
)
|
4638
|
+
headless: registerTypes ? registerTypes.length <= 1 : true,
|
4639
|
+
noPadding: props.cardless
|
4131
4640
|
},
|
4132
|
-
/* @__PURE__ */
|
4641
|
+
/* @__PURE__ */ import_react37.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react37.default.createElement(
|
4133
4642
|
Alert,
|
4134
4643
|
{
|
4135
4644
|
direction: props.direction,
|
@@ -4142,7 +4651,7 @@ var RegisterForm = ({
|
|
4142
4651
|
}
|
4143
4652
|
}
|
4144
4653
|
}
|
4145
|
-
), /* @__PURE__ */
|
4654
|
+
), /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react37.default.createElement(
|
4146
4655
|
"form",
|
4147
4656
|
{
|
4148
4657
|
noValidate: true,
|
@@ -4150,241 +4659,353 @@ var RegisterForm = ({
|
|
4150
4659
|
if (props.onRegister) {
|
4151
4660
|
return props.onRegister(e);
|
4152
4661
|
} else {
|
4153
|
-
console.log(
|
4154
|
-
"Form is submitted but onRegister prop is missing"
|
4155
|
-
);
|
4662
|
+
console.log("Form is submitted but onRegister prop is missing");
|
4156
4663
|
}
|
4157
4664
|
}),
|
4158
4665
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
4159
4666
|
},
|
4160
|
-
/* @__PURE__ */
|
4161
|
-
|
4162
|
-
|
4667
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4668
|
+
Tabs,
|
4669
|
+
{
|
4670
|
+
dir: props.direction,
|
4671
|
+
value: selectedRegisterType.value,
|
4672
|
+
onValueChange: (e) => setSelectedRegisterType(
|
4673
|
+
(registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
|
4674
|
+
label: "Password",
|
4675
|
+
value: "password"
|
4676
|
+
}
|
4677
|
+
)
|
4678
|
+
},
|
4679
|
+
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react37.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-my-4 hawa-mt-6" }, /* @__PURE__ */ import_react37.default.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react37.default.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
|
4680
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4681
|
+
TabsContent,
|
4682
|
+
{
|
4683
|
+
value: "password",
|
4684
|
+
className: cn(
|
4685
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
4686
|
+
selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
|
4687
|
+
),
|
4688
|
+
dir: props.direction
|
4689
|
+
},
|
4690
|
+
/* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
4691
|
+
if (fld === "fullname") {
|
4692
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4693
|
+
import_react_hook_form2.Controller,
|
4694
|
+
{
|
4695
|
+
key: i,
|
4696
|
+
control,
|
4697
|
+
name: "fullName",
|
4698
|
+
render: ({ field }) => {
|
4699
|
+
var _a2, _b2, _c2;
|
4700
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4701
|
+
Input,
|
4702
|
+
{
|
4703
|
+
width: "full",
|
4704
|
+
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
4705
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
4706
|
+
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
4707
|
+
...field
|
4708
|
+
}
|
4709
|
+
);
|
4710
|
+
}
|
4711
|
+
}
|
4712
|
+
);
|
4713
|
+
}
|
4714
|
+
if (fld === "email") {
|
4715
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4716
|
+
import_react_hook_form2.Controller,
|
4717
|
+
{
|
4718
|
+
key: i,
|
4719
|
+
control,
|
4720
|
+
name: "email",
|
4721
|
+
render: ({ field }) => {
|
4722
|
+
var _a2, _b2, _c2;
|
4723
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4724
|
+
Input,
|
4725
|
+
{
|
4726
|
+
dir: "ltr",
|
4727
|
+
inputProps: {
|
4728
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
4729
|
+
},
|
4730
|
+
width: "full",
|
4731
|
+
autoComplete: "email",
|
4732
|
+
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
4733
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
4734
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
4735
|
+
...field,
|
4736
|
+
onChange: (e) => {
|
4737
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
4738
|
+
}
|
4739
|
+
}
|
4740
|
+
);
|
4741
|
+
}
|
4742
|
+
}
|
4743
|
+
);
|
4744
|
+
}
|
4745
|
+
if (fld === "username") {
|
4746
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4747
|
+
import_react_hook_form2.Controller,
|
4748
|
+
{
|
4749
|
+
key: i,
|
4750
|
+
control,
|
4751
|
+
name: "username",
|
4752
|
+
render: ({ field }) => {
|
4753
|
+
var _a2, _b2, _c2, _d2;
|
4754
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4755
|
+
Input,
|
4756
|
+
{
|
4757
|
+
width: "full",
|
4758
|
+
autoComplete: "username",
|
4759
|
+
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
4760
|
+
labelProps: {
|
4761
|
+
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
4762
|
+
},
|
4763
|
+
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
4764
|
+
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
4765
|
+
...field
|
4766
|
+
}
|
4767
|
+
);
|
4768
|
+
}
|
4769
|
+
}
|
4770
|
+
);
|
4771
|
+
}
|
4772
|
+
})),
|
4773
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4163
4774
|
import_react_hook_form2.Controller,
|
4164
4775
|
{
|
4165
|
-
key: i,
|
4166
4776
|
control,
|
4167
|
-
name: "
|
4777
|
+
name: "password",
|
4168
4778
|
render: ({ field }) => {
|
4169
4779
|
var _a2, _b2, _c2;
|
4170
|
-
return /* @__PURE__ */
|
4780
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4171
4781
|
Input,
|
4172
4782
|
{
|
4173
4783
|
width: "full",
|
4174
|
-
|
4175
|
-
|
4176
|
-
|
4784
|
+
type: passwordVisible ? "text" : "password",
|
4785
|
+
autoComplete: "new-password",
|
4786
|
+
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
4787
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
4788
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
4789
|
+
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
4790
|
+
"div",
|
4791
|
+
{
|
4792
|
+
className: "hawa-cursor-pointer",
|
4793
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
4794
|
+
},
|
4795
|
+
passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
4796
|
+
" "
|
4797
|
+
),
|
4177
4798
|
...field
|
4178
4799
|
}
|
4179
4800
|
);
|
4180
4801
|
}
|
4181
4802
|
}
|
4182
|
-
)
|
4183
|
-
|
4184
|
-
if (fld === "email") {
|
4185
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4803
|
+
),
|
4804
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4186
4805
|
import_react_hook_form2.Controller,
|
4187
4806
|
{
|
4188
|
-
key: i,
|
4189
4807
|
control,
|
4190
|
-
name: "
|
4808
|
+
name: "confirm_password",
|
4191
4809
|
render: ({ field }) => {
|
4192
4810
|
var _a2, _b2, _c2;
|
4193
|
-
return /* @__PURE__ */
|
4811
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4194
4812
|
Input,
|
4195
4813
|
{
|
4196
|
-
dir: "ltr",
|
4197
|
-
inputProps: {
|
4198
|
-
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
4199
|
-
},
|
4200
4814
|
width: "full",
|
4201
|
-
|
4202
|
-
|
4203
|
-
|
4204
|
-
placeholder: ((
|
4205
|
-
|
4206
|
-
|
4207
|
-
|
4208
|
-
|
4209
|
-
|
4210
|
-
|
4815
|
+
type: passwordVisible ? "text" : "password",
|
4816
|
+
autoComplete: "new-password",
|
4817
|
+
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
4818
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
4819
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
4820
|
+
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
4821
|
+
"div",
|
4822
|
+
{
|
4823
|
+
className: "hawa-cursor-pointer",
|
4824
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
4825
|
+
},
|
4826
|
+
passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
4827
|
+
" "
|
4828
|
+
),
|
4829
|
+
...field
|
4211
4830
|
}
|
4212
4831
|
);
|
4213
4832
|
}
|
4214
4833
|
}
|
4215
|
-
)
|
4216
|
-
|
4217
|
-
|
4218
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4834
|
+
),
|
4835
|
+
props.additionalInputs,
|
4836
|
+
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
4219
4837
|
import_react_hook_form2.Controller,
|
4220
4838
|
{
|
4221
|
-
key: i,
|
4222
4839
|
control,
|
4223
|
-
name: "
|
4840
|
+
name: "refCode",
|
4224
4841
|
render: ({ field }) => {
|
4225
|
-
var _a2
|
4226
|
-
return /* @__PURE__ */
|
4842
|
+
var _a2;
|
4843
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4227
4844
|
Input,
|
4228
4845
|
{
|
4229
4846
|
width: "full",
|
4230
|
-
|
4231
|
-
|
4232
|
-
|
4233
|
-
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
4234
|
-
},
|
4235
|
-
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
4236
|
-
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
4847
|
+
label: texts == null ? void 0 : texts.refCode,
|
4848
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
4849
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
4237
4850
|
...field
|
4238
4851
|
}
|
4239
4852
|
);
|
4240
4853
|
}
|
4241
4854
|
}
|
4242
|
-
)
|
4243
|
-
|
4244
|
-
|
4245
|
-
|
4246
|
-
|
4247
|
-
|
4248
|
-
|
4249
|
-
|
4250
|
-
|
4251
|
-
|
4252
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4253
|
-
Input,
|
4254
|
-
{
|
4255
|
-
width: "full",
|
4256
|
-
type: passwordVisible ? "text" : "password",
|
4257
|
-
endIcon: /* @__PURE__ */ import_react17.default.createElement(
|
4258
|
-
"div",
|
4855
|
+
),
|
4856
|
+
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
4857
|
+
import_react_hook_form2.Controller,
|
4858
|
+
{
|
4859
|
+
control,
|
4860
|
+
name: "reference",
|
4861
|
+
render: ({ field }) => {
|
4862
|
+
var _a2, _b2;
|
4863
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4864
|
+
Select,
|
4259
4865
|
{
|
4260
|
-
|
4261
|
-
|
4262
|
-
|
4263
|
-
|
4264
|
-
|
4265
|
-
|
4266
|
-
|
4267
|
-
|
4268
|
-
|
4269
|
-
|
4270
|
-
...field
|
4866
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
4867
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
4868
|
+
isCreatable: false,
|
4869
|
+
isMulti: false,
|
4870
|
+
isSearchable: false,
|
4871
|
+
isClearable: false,
|
4872
|
+
options: props.userReferenceOptions || [],
|
4873
|
+
onChange: (e) => field.onChange(e)
|
4874
|
+
}
|
4875
|
+
);
|
4271
4876
|
}
|
4272
|
-
|
4273
|
-
|
4274
|
-
|
4275
|
-
|
4276
|
-
|
4277
|
-
|
4278
|
-
|
4279
|
-
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4284
|
-
|
4285
|
-
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4289
|
-
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
4877
|
+
}
|
4878
|
+
)
|
4879
|
+
),
|
4880
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4881
|
+
TabsContent,
|
4882
|
+
{
|
4883
|
+
value: "phone",
|
4884
|
+
className: cn(
|
4885
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
4886
|
+
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
4887
|
+
),
|
4888
|
+
dir: props.direction
|
4889
|
+
},
|
4890
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4891
|
+
import_react_hook_form2.Controller,
|
4892
|
+
{
|
4893
|
+
control,
|
4894
|
+
name: "phone",
|
4895
|
+
render: ({ field }) => {
|
4896
|
+
var _a2, _b2;
|
4897
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4898
|
+
PhoneInput,
|
4899
|
+
{
|
4900
|
+
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
4901
|
+
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
4902
|
+
preferredCountry: { label: "+966" },
|
4903
|
+
...props.phoneInputProps,
|
4904
|
+
handleChange: (e) => {
|
4905
|
+
if ((0, import_libphonenumber_js2.isValidPhoneNumber)(e) && (0, import_libphonenumber_js2.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(e) === void 0) {
|
4906
|
+
let parsed = (0, import_libphonenumber_js2.parsePhoneNumber)(e);
|
4907
|
+
field.onChange(parsed.number);
|
4908
|
+
} else {
|
4909
|
+
field.onChange(e);
|
4910
|
+
}
|
4911
|
+
}
|
4912
|
+
}
|
4913
|
+
);
|
4293
4914
|
}
|
4294
|
-
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
|
4299
|
-
|
4300
|
-
|
4301
|
-
|
4302
|
-
|
4303
|
-
|
4304
|
-
|
4305
|
-
|
4306
|
-
|
4307
|
-
|
4308
|
-
|
4309
|
-
|
4310
|
-
|
4311
|
-
|
4312
|
-
|
4313
|
-
|
4915
|
+
}
|
4916
|
+
),
|
4917
|
+
props.additionalInputs,
|
4918
|
+
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
4919
|
+
import_react_hook_form2.Controller,
|
4920
|
+
{
|
4921
|
+
control,
|
4922
|
+
name: "refCode",
|
4923
|
+
render: ({ field }) => {
|
4924
|
+
var _a2;
|
4925
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4926
|
+
Input,
|
4927
|
+
{
|
4928
|
+
width: "full",
|
4929
|
+
label: texts == null ? void 0 : texts.refCode,
|
4930
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
4931
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
4932
|
+
...field
|
4933
|
+
}
|
4934
|
+
);
|
4314
4935
|
}
|
4315
|
-
|
4316
|
-
|
4317
|
-
|
4318
|
-
|
4319
|
-
|
4320
|
-
|
4321
|
-
|
4322
|
-
|
4323
|
-
|
4324
|
-
|
4325
|
-
|
4326
|
-
|
4327
|
-
|
4328
|
-
|
4329
|
-
|
4330
|
-
|
4331
|
-
|
4332
|
-
|
4333
|
-
|
4334
|
-
|
4335
|
-
|
4336
|
-
|
4936
|
+
}
|
4937
|
+
),
|
4938
|
+
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
4939
|
+
import_react_hook_form2.Controller,
|
4940
|
+
{
|
4941
|
+
control,
|
4942
|
+
name: "reference",
|
4943
|
+
render: ({ field }) => {
|
4944
|
+
var _a2, _b2;
|
4945
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4946
|
+
Select,
|
4947
|
+
{
|
4948
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
4949
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
4950
|
+
isCreatable: false,
|
4951
|
+
isMulti: false,
|
4952
|
+
isSearchable: false,
|
4953
|
+
isClearable: false,
|
4954
|
+
options: props.userReferenceOptions || [],
|
4955
|
+
onChange: (e) => field.onChange(e)
|
4956
|
+
}
|
4957
|
+
);
|
4337
4958
|
}
|
4338
|
-
|
4959
|
+
}
|
4960
|
+
)
|
4961
|
+
),
|
4962
|
+
showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
|
4963
|
+
import_react_hook_form2.Controller,
|
4964
|
+
{
|
4965
|
+
control,
|
4966
|
+
name: "terms_accepted",
|
4967
|
+
render: ({ field }) => {
|
4968
|
+
var _a2, _b2;
|
4969
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4970
|
+
Checkbox,
|
4971
|
+
{
|
4972
|
+
id: "terms_accepted",
|
4973
|
+
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
4974
|
+
onCheckedChange: (e) => field.onChange(e),
|
4975
|
+
label: /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
|
4976
|
+
"span",
|
4977
|
+
{
|
4978
|
+
onClick: (e) => {
|
4979
|
+
e.preventDefault();
|
4980
|
+
if (props.onRouteToTOS) {
|
4981
|
+
props.onRouteToTOS();
|
4982
|
+
}
|
4983
|
+
},
|
4984
|
+
className: "clickable-link"
|
4985
|
+
},
|
4986
|
+
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
4987
|
+
)))
|
4988
|
+
}
|
4989
|
+
);
|
4990
|
+
}
|
4339
4991
|
}
|
4340
|
-
|
4341
|
-
|
4342
|
-
|
4343
|
-
|
4344
|
-
|
4345
|
-
|
4346
|
-
name: "terms_accepted",
|
4347
|
-
render: ({ field }) => {
|
4348
|
-
var _a2, _b2;
|
4349
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4992
|
+
), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
|
4993
|
+
import_react_hook_form2.Controller,
|
4994
|
+
{
|
4995
|
+
control,
|
4996
|
+
name: "newsletter_accepted",
|
4997
|
+
render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
|
4350
4998
|
Checkbox,
|
4351
4999
|
{
|
4352
|
-
id: "
|
4353
|
-
|
4354
|
-
onCheckedChange:
|
4355
|
-
label: /* @__PURE__ */ import_react17.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react17.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react17.default.createElement(
|
4356
|
-
"span",
|
4357
|
-
{
|
4358
|
-
onClick: (e) => {
|
4359
|
-
e.preventDefault();
|
4360
|
-
if (props.onRouteToTOS) {
|
4361
|
-
props.onRouteToTOS();
|
4362
|
-
}
|
4363
|
-
},
|
4364
|
-
className: "clickable-link"
|
4365
|
-
},
|
4366
|
-
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
4367
|
-
)))
|
5000
|
+
id: "newsletter_accepted",
|
5001
|
+
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
5002
|
+
onCheckedChange: field.onChange
|
4368
5003
|
}
|
4369
|
-
)
|
5004
|
+
)
|
4370
5005
|
}
|
4371
|
-
|
4372
|
-
),
|
4373
|
-
|
4374
|
-
{
|
4375
|
-
control,
|
4376
|
-
name: "newsletter_accepted",
|
4377
|
-
render: ({ field }) => /* @__PURE__ */ import_react17.default.createElement(
|
4378
|
-
Checkbox,
|
4379
|
-
{
|
4380
|
-
id: "newsletter_accepted",
|
4381
|
-
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
4382
|
-
onCheckedChange: field.onChange
|
4383
|
-
}
|
4384
|
-
)
|
4385
|
-
}
|
4386
|
-
)) : null,
|
4387
|
-
/* @__PURE__ */ import_react17.default.createElement(
|
5006
|
+
)) : null
|
5007
|
+
),
|
5008
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4388
5009
|
Button,
|
4389
5010
|
{
|
4390
5011
|
className: "hawa-w-full",
|
@@ -4395,37 +5016,37 @@ var RegisterForm = ({
|
|
4395
5016
|
(texts == null ? void 0 : texts.registerText) || "Register"
|
4396
5017
|
),
|
4397
5018
|
props.additionalButtons
|
4398
|
-
)), props.onRouteToLogin && /* @__PURE__ */
|
4399
|
-
|
4400
|
-
|
4401
|
-
|
4402
|
-
|
4403
|
-
|
4404
|
-
|
4405
|
-
|
4406
|
-
},
|
4407
|
-
/* @__PURE__ */ import_react17.default.createElement(
|
4408
|
-
AuthButtons,
|
4409
|
-
{
|
4410
|
-
texts: thirdPartyAuthTexts,
|
4411
|
-
viaGoogle: props.viaGoogle,
|
4412
|
-
viaGithub: props.viaGithub,
|
4413
|
-
viaTwitter: props.viaTwitter,
|
4414
|
-
isGoogleLoading: props.isGoogleLoading,
|
4415
|
-
isGithubLoading: props.isGithubLoading,
|
4416
|
-
isTwitterLoading: props.isTwitterLoading,
|
4417
|
-
handleGoogle: props.onGoogleRegister,
|
4418
|
-
handleGithub: props.onGithubRegister,
|
4419
|
-
handleTwitter: props.onTwitterRegister
|
4420
|
-
}
|
5019
|
+
)), props.onRouteToLogin && /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ import_react37.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react37.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))
|
5020
|
+
),
|
5021
|
+
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react37.default.createElement(
|
5022
|
+
CardFooter,
|
5023
|
+
{
|
5024
|
+
noPadding: props.cardless,
|
5025
|
+
className: cn(
|
5026
|
+
props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
|
4421
5027
|
)
|
4422
|
-
|
4423
|
-
|
4424
|
-
|
5028
|
+
},
|
5029
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
5030
|
+
AuthButtons,
|
5031
|
+
{
|
5032
|
+
texts: thirdPartyAuthTexts,
|
5033
|
+
viaGoogle: props.viaGoogle,
|
5034
|
+
viaGithub: props.viaGithub,
|
5035
|
+
viaTwitter: props.viaTwitter,
|
5036
|
+
isGoogleLoading: props.isGoogleLoading,
|
5037
|
+
isGithubLoading: props.isGithubLoading,
|
5038
|
+
isTwitterLoading: props.isTwitterLoading,
|
5039
|
+
handleGoogle: props.onGoogleRegister,
|
5040
|
+
handleGithub: props.onGithubRegister,
|
5041
|
+
handleTwitter: props.onTwitterRegister
|
5042
|
+
}
|
5043
|
+
)
|
5044
|
+
) : null
|
5045
|
+
));
|
4425
5046
|
};
|
4426
5047
|
|
4427
5048
|
// blocks/auth/AppLanding.tsx
|
4428
|
-
var
|
5049
|
+
var import_react38 = __toESM(require("react"));
|
4429
5050
|
var AppLanding = ({ texts, ...props }) => {
|
4430
5051
|
const thirdPartyAuthTexts = {
|
4431
5052
|
continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
|
@@ -4436,7 +5057,7 @@ var AppLanding = ({ texts, ...props }) => {
|
|
4436
5057
|
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
4437
5058
|
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
4438
5059
|
};
|
4439
|
-
return /* @__PURE__ */
|
5060
|
+
return /* @__PURE__ */ import_react38.default.createElement("div", { dir: props.direction }, /* @__PURE__ */ import_react38.default.createElement(Card, null, /* @__PURE__ */ import_react38.default.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col hawa-gap-6" }, /* @__PURE__ */ import_react38.default.createElement(
|
4440
5061
|
AuthButtons,
|
4441
5062
|
{
|
4442
5063
|
texts: thirdPartyAuthTexts,
|
@@ -4455,7 +5076,7 @@ var AppLanding = ({ texts, ...props }) => {
|
|
4455
5076
|
handleEmail: props.handleEmail,
|
4456
5077
|
handlePhone: props.handlePhone
|
4457
5078
|
}
|
4458
|
-
), props.allowRegister && /* @__PURE__ */
|
5079
|
+
), props.allowRegister && /* @__PURE__ */ import_react38.default.createElement("div", { className: "hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, texts == null ? void 0 : texts.newUserText, " ", /* @__PURE__ */ import_react38.default.createElement(
|
4459
5080
|
"span",
|
4460
5081
|
{
|
4461
5082
|
onClick: props.handleRouteToRegister,
|
@@ -4466,9 +5087,9 @@ var AppLanding = ({ texts, ...props }) => {
|
|
4466
5087
|
};
|
4467
5088
|
|
4468
5089
|
// blocks/auth/CheckEmail.tsx
|
4469
|
-
var
|
5090
|
+
var import_react39 = __toESM(require("react"));
|
4470
5091
|
var CheckEmail = ({ texts, handleResend }) => {
|
4471
|
-
return /* @__PURE__ */
|
5092
|
+
return /* @__PURE__ */ import_react39.default.createElement(Card, null, /* @__PURE__ */ import_react39.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ import_react39.default.createElement(
|
4472
5093
|
"svg",
|
4473
5094
|
{
|
4474
5095
|
stroke: "currentColor",
|
@@ -4481,13 +5102,13 @@ var CheckEmail = ({ texts, handleResend }) => {
|
|
4481
5102
|
width: "0.5em",
|
4482
5103
|
xmlns: "http://www.w3.org/2000/svg"
|
4483
5104
|
},
|
4484
|
-
/* @__PURE__ */
|
4485
|
-
/* @__PURE__ */
|
4486
|
-
)), /* @__PURE__ */
|
5105
|
+
/* @__PURE__ */ import_react39.default.createElement("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
|
5106
|
+
/* @__PURE__ */ import_react39.default.createElement("polyline", { points: "22,6 12,13 2,6" })
|
5107
|
+
)), /* @__PURE__ */ import_react39.default.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ import_react39.default.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ import_react39.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center" }, /* @__PURE__ */ import_react39.default.createElement("span", { className: "clickable-link hawa-text-sm", onClick: handleResend }, (texts == null ? void 0 : texts.resendEmail) || "Resend Email")));
|
4487
5108
|
};
|
4488
5109
|
|
4489
5110
|
// blocks/auth/NewPassword.tsx
|
4490
|
-
var
|
5111
|
+
var import_react40 = __toESM(require("react"));
|
4491
5112
|
var import_react_hook_form3 = require("react-hook-form");
|
4492
5113
|
var import_zod3 = require("@hookform/resolvers/zod");
|
4493
5114
|
var z3 = __toESM(require("zod"));
|
@@ -4509,7 +5130,7 @@ var NewPasswordForm = ({
|
|
4509
5130
|
const { handleSubmit, control, formState } = (0, import_react_hook_form3.useForm)({
|
4510
5131
|
resolver: (0, import_zod3.zodResolver)(formSchema)
|
4511
5132
|
});
|
4512
|
-
return /* @__PURE__ */
|
5133
|
+
return /* @__PURE__ */ import_react40.default.createElement(Card, { dir: props.direction }, props.showSuccess ? /* @__PURE__ */ import_react40.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react40.default.createElement("div", { className: "hawa-text-center" }, texts == null ? void 0 : texts.passwordChanged)) : /* @__PURE__ */ import_react40.default.createElement(
|
4513
5134
|
"form",
|
4514
5135
|
{
|
4515
5136
|
noValidate: true,
|
@@ -4523,7 +5144,7 @@ var NewPasswordForm = ({
|
|
4523
5144
|
}
|
4524
5145
|
})
|
4525
5146
|
},
|
4526
|
-
/* @__PURE__ */
|
5147
|
+
/* @__PURE__ */ import_react40.default.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col" }, props.showError && /* @__PURE__ */ import_react40.default.createElement(
|
4527
5148
|
Alert,
|
4528
5149
|
{
|
4529
5150
|
direction: props.direction,
|
@@ -4531,14 +5152,14 @@ var NewPasswordForm = ({
|
|
4531
5152
|
text: props.errorText,
|
4532
5153
|
severity: "error"
|
4533
5154
|
}
|
4534
|
-
), /* @__PURE__ */
|
5155
|
+
), /* @__PURE__ */ import_react40.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4 hawa-mb-4" }, /* @__PURE__ */ import_react40.default.createElement(
|
4535
5156
|
import_react_hook_form3.Controller,
|
4536
5157
|
{
|
4537
5158
|
control,
|
4538
5159
|
name: "password",
|
4539
5160
|
render: ({ field }) => {
|
4540
5161
|
var _a2, _b2, _c2;
|
4541
|
-
return /* @__PURE__ */
|
5162
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
4542
5163
|
Input,
|
4543
5164
|
{
|
4544
5165
|
width: "full",
|
@@ -4552,14 +5173,14 @@ var NewPasswordForm = ({
|
|
4552
5173
|
);
|
4553
5174
|
}
|
4554
5175
|
}
|
4555
|
-
), /* @__PURE__ */
|
5176
|
+
), /* @__PURE__ */ import_react40.default.createElement(
|
4556
5177
|
import_react_hook_form3.Controller,
|
4557
5178
|
{
|
4558
5179
|
control,
|
4559
5180
|
name: "confirm_password",
|
4560
5181
|
render: ({ field }) => {
|
4561
5182
|
var _a2, _b2, _c2;
|
4562
|
-
return /* @__PURE__ */
|
5183
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
4563
5184
|
Input,
|
4564
5185
|
{
|
4565
5186
|
width: "full",
|
@@ -4573,7 +5194,7 @@ var NewPasswordForm = ({
|
|
4573
5194
|
);
|
4574
5195
|
}
|
4575
5196
|
}
|
4576
|
-
)), /* @__PURE__ */
|
5197
|
+
)), /* @__PURE__ */ import_react40.default.createElement(Button, { className: "hawa-w-full", type: "submit", isLoading }, texts == null ? void 0 : texts.updatePassword), props.allowRegister && /* @__PURE__ */ import_react40.default.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_g = texts == null ? void 0 : texts.dontHaveAccount) != null ? _g : "Don't have an account? ", /* @__PURE__ */ import_react40.default.createElement(
|
4577
5198
|
"span",
|
4578
5199
|
{
|
4579
5200
|
className: "clickable-link",
|
@@ -4585,7 +5206,7 @@ var NewPasswordForm = ({
|
|
4585
5206
|
};
|
4586
5207
|
|
4587
5208
|
// blocks/auth/ResetPassword.tsx
|
4588
|
-
var
|
5209
|
+
var import_react41 = __toESM(require("react"));
|
4589
5210
|
var import_react_hook_form4 = require("react-hook-form");
|
4590
5211
|
var import_zod4 = require("@hookform/resolvers/zod");
|
4591
5212
|
var z4 = __toESM(require("zod"));
|
@@ -4603,7 +5224,7 @@ var ResetPasswordForm = ({
|
|
4603
5224
|
const { handleSubmit, control, formState } = (0, import_react_hook_form4.useForm)({
|
4604
5225
|
resolver: (0, import_zod4.zodResolver)(formSchema)
|
4605
5226
|
});
|
4606
|
-
return /* @__PURE__ */
|
5227
|
+
return /* @__PURE__ */ import_react41.default.createElement(Card, { dir: props.direction }, !props.sent ? /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null, !props.headless && /* @__PURE__ */ import_react41.default.createElement(CardHeader, null, /* @__PURE__ */ import_react41.default.createElement(CardTitle, null, ((_g = props.texts) == null ? void 0 : _g.headTitle) || "Reset Password"), /* @__PURE__ */ import_react41.default.createElement(CardDescription, null, ((_h = props.texts) == null ? void 0 : _h.headDescription) || "Enter your email to reset your account password")), /* @__PURE__ */ import_react41.default.createElement(
|
4607
5228
|
"form",
|
4608
5229
|
{
|
4609
5230
|
noValidate: true,
|
@@ -4615,7 +5236,7 @@ var ResetPasswordForm = ({
|
|
4615
5236
|
}
|
4616
5237
|
})
|
4617
5238
|
},
|
4618
|
-
/* @__PURE__ */
|
5239
|
+
/* @__PURE__ */ import_react41.default.createElement(CardContent, { headless: props.headless, className: "hawa-pb-4" }, props.showError && /* @__PURE__ */ import_react41.default.createElement(
|
4619
5240
|
Alert,
|
4620
5241
|
{
|
4621
5242
|
direction: props.direction,
|
@@ -4623,14 +5244,14 @@ var ResetPasswordForm = ({
|
|
4623
5244
|
text: props.errorText,
|
4624
5245
|
severity: "error"
|
4625
5246
|
}
|
4626
|
-
), /* @__PURE__ */
|
5247
|
+
), /* @__PURE__ */ import_react41.default.createElement(
|
4627
5248
|
import_react_hook_form4.Controller,
|
4628
5249
|
{
|
4629
5250
|
control,
|
4630
5251
|
name: "email",
|
4631
5252
|
render: ({ field }) => {
|
4632
5253
|
var _a2, _b2, _c2, _d2, _e2;
|
4633
|
-
return /* @__PURE__ */
|
5254
|
+
return /* @__PURE__ */ import_react41.default.createElement(
|
4634
5255
|
Input,
|
4635
5256
|
{
|
4636
5257
|
width: "full",
|
@@ -4646,7 +5267,7 @@ var ResetPasswordForm = ({
|
|
4646
5267
|
}
|
4647
5268
|
}
|
4648
5269
|
)),
|
4649
|
-
/* @__PURE__ */
|
5270
|
+
/* @__PURE__ */ import_react41.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ import_react41.default.createElement(
|
4650
5271
|
Button,
|
4651
5272
|
{
|
4652
5273
|
type: "submit",
|
@@ -4654,7 +5275,7 @@ var ResetPasswordForm = ({
|
|
4654
5275
|
isLoading
|
4655
5276
|
},
|
4656
5277
|
((_i = props.texts) == null ? void 0 : _i.resetPassword) || "Reset Password"
|
4657
|
-
), allowRegister && /* @__PURE__ */
|
5278
|
+
), allowRegister && /* @__PURE__ */ import_react41.default.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_k = (_j = props.texts) == null ? void 0 : _j.dontHaveAccount) != null ? _k : "Don't have an account? ", /* @__PURE__ */ import_react41.default.createElement(
|
4658
5279
|
"span",
|
4659
5280
|
{
|
4660
5281
|
className: "clickable-link",
|
@@ -4662,21 +5283,21 @@ var ResetPasswordForm = ({
|
|
4662
5283
|
},
|
4663
5284
|
(_m = (_l = props.texts) == null ? void 0 : _l.registerText) != null ? _m : "Register"
|
4664
5285
|
)))
|
4665
|
-
)) : /* @__PURE__ */
|
5286
|
+
)) : /* @__PURE__ */ import_react41.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react41.default.createElement("div", { className: "hawa-text-center" }, ((_n = props.texts) == null ? void 0 : _n.emailSentText) || "An email has been sent with a link to set a new password")));
|
4666
5287
|
};
|
4667
5288
|
|
4668
5289
|
// blocks/auth/CodeConfirmation.tsx
|
4669
|
-
var
|
5290
|
+
var import_react44 = __toESM(require("react"));
|
4670
5291
|
var import_react_hook_form5 = require("react-hook-form");
|
4671
5292
|
var import_zod5 = require("@hookform/resolvers/zod");
|
4672
5293
|
var z5 = __toESM(require("zod"));
|
4673
5294
|
|
4674
5295
|
// elements/pinInput/PinInput.tsx
|
4675
|
-
var
|
5296
|
+
var React36 = __toESM(require("react"));
|
4676
5297
|
var import_input_otp = require("input-otp");
|
4677
5298
|
|
4678
5299
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
4679
|
-
var
|
5300
|
+
var import_react43 = require("react");
|
4680
5301
|
|
4681
5302
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
4682
5303
|
var toKebabCase = (string6) => string6.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
@@ -4685,7 +5306,7 @@ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
4685
5306
|
}).join(" ");
|
4686
5307
|
|
4687
5308
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
4688
|
-
var
|
5309
|
+
var import_react42 = require("react");
|
4689
5310
|
|
4690
5311
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
4691
5312
|
var defaultAttributes = {
|
@@ -4701,7 +5322,7 @@ var defaultAttributes = {
|
|
4701
5322
|
};
|
4702
5323
|
|
4703
5324
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
4704
|
-
var Icon = (0,
|
5325
|
+
var Icon = (0, import_react42.forwardRef)(
|
4705
5326
|
({
|
4706
5327
|
color = "currentColor",
|
4707
5328
|
size = 24,
|
@@ -4712,7 +5333,7 @@ var Icon = (0, import_react22.forwardRef)(
|
|
4712
5333
|
iconNode,
|
4713
5334
|
...rest
|
4714
5335
|
}, ref) => {
|
4715
|
-
return (0,
|
5336
|
+
return (0, import_react42.createElement)(
|
4716
5337
|
"svg",
|
4717
5338
|
{
|
4718
5339
|
ref,
|
@@ -4725,7 +5346,7 @@ var Icon = (0, import_react22.forwardRef)(
|
|
4725
5346
|
...rest
|
4726
5347
|
},
|
4727
5348
|
[
|
4728
|
-
...iconNode.map(([tag, attrs]) => (0,
|
5349
|
+
...iconNode.map(([tag, attrs]) => (0, import_react42.createElement)(tag, attrs)),
|
4729
5350
|
...Array.isArray(children) ? children : [children]
|
4730
5351
|
]
|
4731
5352
|
);
|
@@ -4734,8 +5355,8 @@ var Icon = (0, import_react22.forwardRef)(
|
|
4734
5355
|
|
4735
5356
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
4736
5357
|
var createLucideIcon = (iconName, iconNode) => {
|
4737
|
-
const Component = (0,
|
4738
|
-
({ className, ...props }, ref) => (0,
|
5358
|
+
const Component = (0, import_react43.forwardRef)(
|
5359
|
+
({ className, ...props }, ref) => (0, import_react43.createElement)(Icon, {
|
4739
5360
|
ref,
|
4740
5361
|
iconNode,
|
4741
5362
|
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
@@ -4752,7 +5373,7 @@ var Dot = createLucideIcon("Dot", [
|
|
4752
5373
|
]);
|
4753
5374
|
|
4754
5375
|
// elements/pinInput/PinInput.tsx
|
4755
|
-
var PinInputRoot =
|
5376
|
+
var PinInputRoot = React36.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React36.createElement(
|
4756
5377
|
import_input_otp.OTPInput,
|
4757
5378
|
{
|
4758
5379
|
ref,
|
@@ -4765,12 +5386,12 @@ var PinInputRoot = React25.forwardRef(({ className, containerClassName, ...props
|
|
4765
5386
|
}
|
4766
5387
|
));
|
4767
5388
|
PinInputRoot.displayName = "PinInputRoot";
|
4768
|
-
var PinInputGroup =
|
5389
|
+
var PinInputGroup = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React36.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
|
4769
5390
|
PinInputGroup.displayName = "PinInputGroup";
|
4770
|
-
var PinInputSlot =
|
4771
|
-
const pinInputContext =
|
5391
|
+
var PinInputSlot = React36.forwardRef(({ index, className, ...props }, ref) => {
|
5392
|
+
const pinInputContext = React36.useContext(import_input_otp.OTPInputContext);
|
4772
5393
|
const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
|
4773
|
-
return /* @__PURE__ */
|
5394
|
+
return /* @__PURE__ */ React36.createElement(
|
4774
5395
|
"div",
|
4775
5396
|
{
|
4776
5397
|
ref,
|
@@ -4782,25 +5403,25 @@ var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
|
|
4782
5403
|
...props
|
4783
5404
|
},
|
4784
5405
|
char,
|
4785
|
-
hasFakeCaret && /* @__PURE__ */
|
5406
|
+
hasFakeCaret && /* @__PURE__ */ React36.createElement("div", { className: "hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React36.createElement("div", { className: "hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000" }))
|
4786
5407
|
);
|
4787
5408
|
});
|
4788
5409
|
PinInputSlot.displayName = "PinInputSlot";
|
4789
|
-
var PinInputSeperator =
|
5410
|
+
var PinInputSeperator = React36.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React36.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React36.createElement(Dot, null)));
|
4790
5411
|
PinInputSeperator.displayName = "PinInputSeperator";
|
4791
5412
|
var PinInput = ({ separatorPosition = 0, ...props }) => {
|
4792
5413
|
const maxLength = props.maxLength || 6;
|
4793
5414
|
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
4794
5415
|
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
4795
5416
|
const secondGroupLength = maxLength - firstGroupLength;
|
4796
|
-
return /* @__PURE__ */
|
5417
|
+
return /* @__PURE__ */ React36.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React36.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React36.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React36.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React36.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React36.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React36.createElement(
|
4797
5418
|
PinInputSlot,
|
4798
5419
|
{
|
4799
5420
|
key: index + firstGroupLength,
|
4800
5421
|
index: index + firstGroupLength,
|
4801
5422
|
className: "hawa-w-full hawa-border"
|
4802
5423
|
}
|
4803
|
-
)))), /* @__PURE__ */
|
5424
|
+
)))), /* @__PURE__ */ React36.createElement(HelperText, { helperText: props.helperText }));
|
4804
5425
|
};
|
4805
5426
|
|
4806
5427
|
// blocks/auth/CodeConfirmation.tsx
|
@@ -4812,9 +5433,9 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4812
5433
|
const { handleSubmit, control, formState, setValue } = (0, import_react_hook_form5.useForm)({
|
4813
5434
|
resolver: (0, import_zod5.zodResolver)(formSchema)
|
4814
5435
|
});
|
4815
|
-
const [resendTimer, setResendTimer] = (0,
|
4816
|
-
const [remainingTime, setRemainingTime] = (0,
|
4817
|
-
const [showResendTimer, setShowResendTimer] = (0,
|
5436
|
+
const [resendTimer, setResendTimer] = (0, import_react44.useState)(null);
|
5437
|
+
const [remainingTime, setRemainingTime] = (0, import_react44.useState)(0);
|
5438
|
+
const [showResendTimer, setShowResendTimer] = (0, import_react44.useState)(false);
|
4818
5439
|
const startResendTimer = () => {
|
4819
5440
|
if (resendTimer !== null) {
|
4820
5441
|
clearInterval(resendTimer);
|
@@ -4836,14 +5457,14 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4836
5457
|
}, 1e3);
|
4837
5458
|
setResendTimer(newTimer);
|
4838
5459
|
};
|
4839
|
-
(0,
|
5460
|
+
(0, import_react44.useEffect)(() => {
|
4840
5461
|
return () => {
|
4841
5462
|
if (resendTimer !== null) {
|
4842
5463
|
clearInterval(resendTimer);
|
4843
5464
|
}
|
4844
5465
|
};
|
4845
5466
|
}, []);
|
4846
|
-
return /* @__PURE__ */
|
5467
|
+
return /* @__PURE__ */ import_react44.default.createElement(Card, null, /* @__PURE__ */ import_react44.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react44.default.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react44.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react44.default.createElement("span", null, props.identifier))), /* @__PURE__ */ import_react44.default.createElement(
|
4847
5468
|
"form",
|
4848
5469
|
{
|
4849
5470
|
noValidate: true,
|
@@ -4855,14 +5476,14 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4855
5476
|
}
|
4856
5477
|
})
|
4857
5478
|
},
|
4858
|
-
/* @__PURE__ */
|
5479
|
+
/* @__PURE__ */ import_react44.default.createElement(
|
4859
5480
|
import_react_hook_form5.Controller,
|
4860
5481
|
{
|
4861
5482
|
control,
|
4862
5483
|
name: "otp_code",
|
4863
5484
|
render: ({ field }) => {
|
4864
5485
|
var _a2;
|
4865
|
-
return /* @__PURE__ */
|
5486
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
4866
5487
|
PinInput,
|
4867
5488
|
{
|
4868
5489
|
maxLength: codeLength,
|
@@ -4873,7 +5494,7 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4873
5494
|
}
|
4874
5495
|
}
|
4875
5496
|
),
|
4876
|
-
showResendTimer ? /* @__PURE__ */
|
5497
|
+
showResendTimer ? /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react44.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react44.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react44.default.createElement(
|
4877
5498
|
"span",
|
4878
5499
|
{
|
4879
5500
|
className: "clickable-link",
|
@@ -4884,7 +5505,7 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4884
5505
|
},
|
4885
5506
|
((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
|
4886
5507
|
)),
|
4887
|
-
/* @__PURE__ */
|
5508
|
+
/* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react44.default.createElement(
|
4888
5509
|
Button,
|
4889
5510
|
{
|
4890
5511
|
type: "button",
|
@@ -4898,7 +5519,7 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4898
5519
|
variant: "outline"
|
4899
5520
|
},
|
4900
5521
|
((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"
|
4901
|
-
), /* @__PURE__ */
|
5522
|
+
), /* @__PURE__ */ import_react44.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
|
4902
5523
|
)));
|
4903
5524
|
};
|
4904
5525
|
// Annotate the CommonJS export names for ESM import in node:
|