@sikka/hawa 0.47.0-next → 0.48.1-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/auth/index.d.mts +27 -9
- package/dist/blocks/auth/index.d.ts +27 -9
- package/dist/blocks/auth/index.js +988 -354
- package/dist/blocks/auth/index.mjs +473 -298
- package/dist/blocks/feedback/index.d.mts +1 -1
- package/dist/blocks/feedback/index.d.ts +1 -1
- package/dist/blocks/index.d.mts +26 -8
- package/dist/blocks/index.d.ts +26 -8
- package/dist/blocks/index.js +2290 -2127
- package/dist/blocks/index.mjs +467 -297
- 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 +3 -0
- package/dist/index.d.mts +27 -8
- package/dist/index.d.ts +27 -8
- package/dist/index.js +461 -296
- package/dist/index.mjs +466 -296
- 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,351 +4560,506 @@ 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__ */
|
4133
|
-
|
4641
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4642
|
+
"div",
|
4134
4643
|
{
|
4135
|
-
|
4136
|
-
|
4137
|
-
|
4138
|
-
|
4139
|
-
|
4140
|
-
|
4141
|
-
|
4644
|
+
className: cn(registerTypes && registerTypes.length > 1 ? "hawa-mt-6 hawa-mb-0" : "")
|
4645
|
+
},
|
4646
|
+
props.showError && /* @__PURE__ */ import_react37.default.createElement(
|
4647
|
+
Alert,
|
4648
|
+
{
|
4649
|
+
direction: props.direction,
|
4650
|
+
title: props.errorTitle,
|
4651
|
+
text: props.errorText,
|
4652
|
+
severity: "error",
|
4653
|
+
onAlertClosed: () => {
|
4654
|
+
if (props.onErrorDismissed) {
|
4655
|
+
props.onErrorDismissed();
|
4656
|
+
}
|
4142
4657
|
}
|
4143
4658
|
}
|
4144
|
-
|
4145
|
-
|
4146
|
-
|
4147
|
-
|
4148
|
-
|
4149
|
-
|
4150
|
-
|
4151
|
-
|
4152
|
-
|
4153
|
-
|
4154
|
-
|
4155
|
-
|
4156
|
-
|
4157
|
-
}
|
4158
|
-
|
4159
|
-
|
4160
|
-
|
4161
|
-
|
4162
|
-
|
4163
|
-
|
4659
|
+
),
|
4660
|
+
/* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react37.default.createElement(
|
4661
|
+
"form",
|
4662
|
+
{
|
4663
|
+
noValidate: true,
|
4664
|
+
onSubmit: handleSubmit((e) => {
|
4665
|
+
if (props.onRegister) {
|
4666
|
+
return props.onRegister(e);
|
4667
|
+
} else {
|
4668
|
+
console.log("Form is submitted but onRegister prop is missing");
|
4669
|
+
}
|
4670
|
+
}),
|
4671
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
4672
|
+
},
|
4673
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4674
|
+
Tabs,
|
4675
|
+
{
|
4676
|
+
dir: props.direction,
|
4677
|
+
value: selectedRegisterType.value,
|
4678
|
+
onValueChange: (e) => {
|
4679
|
+
if (props.onRegisterTypeChange) {
|
4680
|
+
props.onRegisterTypeChange(e);
|
4681
|
+
}
|
4682
|
+
setSelectedRegisterType(
|
4683
|
+
(registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
|
4684
|
+
label: "Password",
|
4685
|
+
value: "password"
|
4686
|
+
}
|
4687
|
+
);
|
4688
|
+
}
|
4689
|
+
},
|
4690
|
+
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react37.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-mb-4" }, /* @__PURE__ */ import_react37.default.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react37.default.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
|
4691
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4692
|
+
TabsContent,
|
4164
4693
|
{
|
4165
|
-
|
4166
|
-
|
4167
|
-
|
4168
|
-
|
4169
|
-
|
4170
|
-
|
4171
|
-
|
4694
|
+
value: "password",
|
4695
|
+
className: cn(
|
4696
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
4697
|
+
selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
|
4698
|
+
),
|
4699
|
+
dir: props.direction
|
4700
|
+
},
|
4701
|
+
/* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
4702
|
+
if (fld === "fullname") {
|
4703
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4704
|
+
import_react_hook_form2.Controller,
|
4172
4705
|
{
|
4173
|
-
|
4174
|
-
|
4175
|
-
|
4176
|
-
|
4177
|
-
|
4706
|
+
key: i,
|
4707
|
+
control,
|
4708
|
+
name: "fullName",
|
4709
|
+
render: ({ field }) => {
|
4710
|
+
var _a2, _b2, _c2;
|
4711
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4712
|
+
Input,
|
4713
|
+
{
|
4714
|
+
width: "full",
|
4715
|
+
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
4716
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
4717
|
+
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
4718
|
+
...field
|
4719
|
+
}
|
4720
|
+
);
|
4721
|
+
}
|
4178
4722
|
}
|
4179
4723
|
);
|
4180
4724
|
}
|
4181
|
-
|
4182
|
-
|
4183
|
-
|
4184
|
-
if (fld === "email") {
|
4185
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4186
|
-
import_react_hook_form2.Controller,
|
4187
|
-
{
|
4188
|
-
key: i,
|
4189
|
-
control,
|
4190
|
-
name: "email",
|
4191
|
-
render: ({ field }) => {
|
4192
|
-
var _a2, _b2, _c2;
|
4193
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4194
|
-
Input,
|
4725
|
+
if (fld === "email") {
|
4726
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4727
|
+
import_react_hook_form2.Controller,
|
4195
4728
|
{
|
4196
|
-
|
4197
|
-
|
4198
|
-
|
4199
|
-
}
|
4200
|
-
|
4201
|
-
|
4202
|
-
|
4203
|
-
|
4204
|
-
|
4205
|
-
|
4206
|
-
|
4207
|
-
|
4208
|
-
|
4729
|
+
key: i,
|
4730
|
+
control,
|
4731
|
+
name: "email",
|
4732
|
+
render: ({ field }) => {
|
4733
|
+
var _a2, _b2, _c2;
|
4734
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4735
|
+
Input,
|
4736
|
+
{
|
4737
|
+
dir: "ltr",
|
4738
|
+
inputProps: {
|
4739
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
4740
|
+
},
|
4741
|
+
width: "full",
|
4742
|
+
autoComplete: "email",
|
4743
|
+
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
4744
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
4745
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
4746
|
+
...field,
|
4747
|
+
onChange: (e) => {
|
4748
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
4749
|
+
}
|
4750
|
+
}
|
4209
4751
|
);
|
4210
4752
|
}
|
4211
4753
|
}
|
4212
4754
|
);
|
4213
4755
|
}
|
4214
|
-
|
4215
|
-
|
4216
|
-
|
4217
|
-
if (fld === "username") {
|
4218
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4219
|
-
import_react_hook_form2.Controller,
|
4220
|
-
{
|
4221
|
-
key: i,
|
4222
|
-
control,
|
4223
|
-
name: "username",
|
4224
|
-
render: ({ field }) => {
|
4225
|
-
var _a2, _b2, _c2, _d2;
|
4226
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4227
|
-
Input,
|
4756
|
+
if (fld === "username") {
|
4757
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4758
|
+
import_react_hook_form2.Controller,
|
4228
4759
|
{
|
4229
|
-
|
4230
|
-
|
4231
|
-
|
4232
|
-
|
4233
|
-
|
4234
|
-
|
4235
|
-
|
4236
|
-
|
4237
|
-
|
4760
|
+
key: i,
|
4761
|
+
control,
|
4762
|
+
name: "username",
|
4763
|
+
render: ({ field }) => {
|
4764
|
+
var _a2, _b2, _c2, _d2;
|
4765
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4766
|
+
Input,
|
4767
|
+
{
|
4768
|
+
width: "full",
|
4769
|
+
autoComplete: "username",
|
4770
|
+
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
4771
|
+
labelProps: {
|
4772
|
+
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
4773
|
+
},
|
4774
|
+
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
4775
|
+
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
4776
|
+
...field
|
4777
|
+
}
|
4778
|
+
);
|
4779
|
+
}
|
4238
4780
|
}
|
4239
4781
|
);
|
4240
4782
|
}
|
4241
|
-
}
|
4242
|
-
|
4243
|
-
|
4244
|
-
})),
|
4245
|
-
/* @__PURE__ */ import_react17.default.createElement(
|
4246
|
-
import_react_hook_form2.Controller,
|
4247
|
-
{
|
4248
|
-
control,
|
4249
|
-
name: "password",
|
4250
|
-
render: ({ field }) => {
|
4251
|
-
var _a2, _b2, _c2;
|
4252
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4253
|
-
Input,
|
4783
|
+
})),
|
4784
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4785
|
+
import_react_hook_form2.Controller,
|
4254
4786
|
{
|
4255
|
-
|
4256
|
-
|
4257
|
-
|
4258
|
-
|
4259
|
-
|
4260
|
-
|
4261
|
-
|
4262
|
-
|
4263
|
-
|
4264
|
-
|
4265
|
-
|
4266
|
-
|
4267
|
-
|
4268
|
-
|
4269
|
-
|
4270
|
-
|
4787
|
+
control,
|
4788
|
+
name: "password",
|
4789
|
+
render: ({ field }) => {
|
4790
|
+
var _a2, _b2, _c2;
|
4791
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4792
|
+
Input,
|
4793
|
+
{
|
4794
|
+
width: "full",
|
4795
|
+
type: passwordVisible ? "text" : "password",
|
4796
|
+
autoComplete: "new-password",
|
4797
|
+
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
4798
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
4799
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
4800
|
+
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
4801
|
+
"div",
|
4802
|
+
{
|
4803
|
+
className: "hawa-cursor-pointer",
|
4804
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
4805
|
+
},
|
4806
|
+
passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
4807
|
+
" "
|
4808
|
+
),
|
4809
|
+
...field
|
4810
|
+
}
|
4811
|
+
);
|
4812
|
+
}
|
4271
4813
|
}
|
4272
|
-
)
|
4273
|
-
|
4274
|
-
|
4275
|
-
),
|
4276
|
-
/* @__PURE__ */ import_react17.default.createElement(
|
4277
|
-
import_react_hook_form2.Controller,
|
4278
|
-
{
|
4279
|
-
control,
|
4280
|
-
name: "confirm_password",
|
4281
|
-
render: ({ field }) => {
|
4282
|
-
var _a2, _b2, _c2;
|
4283
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4284
|
-
Input,
|
4814
|
+
),
|
4815
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4816
|
+
import_react_hook_form2.Controller,
|
4285
4817
|
{
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4289
|
-
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
4818
|
+
control,
|
4819
|
+
name: "confirm_password",
|
4820
|
+
render: ({ field }) => {
|
4821
|
+
var _a2, _b2, _c2;
|
4822
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4823
|
+
Input,
|
4824
|
+
{
|
4825
|
+
width: "full",
|
4826
|
+
type: passwordVisible ? "text" : "password",
|
4827
|
+
autoComplete: "new-password",
|
4828
|
+
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
4829
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
4830
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
4831
|
+
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
4832
|
+
"div",
|
4833
|
+
{
|
4834
|
+
className: "hawa-cursor-pointer",
|
4835
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
4836
|
+
},
|
4837
|
+
passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
4838
|
+
" "
|
4839
|
+
),
|
4840
|
+
...field
|
4841
|
+
}
|
4842
|
+
);
|
4843
|
+
}
|
4293
4844
|
}
|
4294
|
-
)
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
props.additionalInputs,
|
4299
|
-
props.showRefCode && /* @__PURE__ */ import_react17.default.createElement(
|
4300
|
-
import_react_hook_form2.Controller,
|
4301
|
-
{
|
4302
|
-
control,
|
4303
|
-
name: "refCode",
|
4304
|
-
render: ({ field }) => {
|
4305
|
-
var _a2;
|
4306
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4307
|
-
Input,
|
4845
|
+
),
|
4846
|
+
props.additionalInputs,
|
4847
|
+
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
4848
|
+
import_react_hook_form2.Controller,
|
4308
4849
|
{
|
4309
|
-
|
4310
|
-
|
4311
|
-
|
4312
|
-
|
4313
|
-
|
4850
|
+
control,
|
4851
|
+
name: "refCode",
|
4852
|
+
render: ({ field }) => {
|
4853
|
+
var _a2;
|
4854
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4855
|
+
Input,
|
4856
|
+
{
|
4857
|
+
width: "full",
|
4858
|
+
label: texts == null ? void 0 : texts.refCode,
|
4859
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
4860
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
4861
|
+
...field
|
4862
|
+
}
|
4863
|
+
);
|
4864
|
+
}
|
4314
4865
|
}
|
4315
|
-
)
|
4316
|
-
|
4317
|
-
|
4318
|
-
),
|
4319
|
-
props.showUserSource && /* @__PURE__ */ import_react17.default.createElement(
|
4320
|
-
import_react_hook_form2.Controller,
|
4321
|
-
{
|
4322
|
-
control,
|
4323
|
-
name: "reference",
|
4324
|
-
render: ({ field }) => {
|
4325
|
-
var _a2, _b2;
|
4326
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
4327
|
-
Select,
|
4866
|
+
),
|
4867
|
+
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
4868
|
+
import_react_hook_form2.Controller,
|
4328
4869
|
{
|
4329
|
-
|
4330
|
-
|
4331
|
-
|
4332
|
-
|
4333
|
-
|
4334
|
-
|
4335
|
-
|
4336
|
-
|
4870
|
+
control,
|
4871
|
+
name: "reference",
|
4872
|
+
render: ({ field }) => {
|
4873
|
+
var _a2, _b2;
|
4874
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4875
|
+
Select,
|
4876
|
+
{
|
4877
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
4878
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
4879
|
+
isCreatable: false,
|
4880
|
+
isMulti: false,
|
4881
|
+
isSearchable: false,
|
4882
|
+
isClearable: false,
|
4883
|
+
options: props.userReferenceOptions || [],
|
4884
|
+
onChange: (e) => field.onChange(e)
|
4885
|
+
}
|
4886
|
+
);
|
4887
|
+
}
|
4337
4888
|
}
|
4338
|
-
)
|
4339
|
-
|
4340
|
-
|
4341
|
-
|
4342
|
-
|
4343
|
-
|
4344
|
-
|
4345
|
-
|
4346
|
-
|
4347
|
-
|
4348
|
-
|
4349
|
-
|
4350
|
-
|
4889
|
+
)
|
4890
|
+
),
|
4891
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4892
|
+
TabsContent,
|
4893
|
+
{
|
4894
|
+
value: "phone",
|
4895
|
+
className: cn(
|
4896
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
4897
|
+
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
4898
|
+
),
|
4899
|
+
dir: props.direction
|
4900
|
+
},
|
4901
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4902
|
+
import_react_hook_form2.Controller,
|
4351
4903
|
{
|
4352
|
-
|
4353
|
-
|
4354
|
-
|
4355
|
-
|
4356
|
-
|
4357
|
-
|
4358
|
-
|
4359
|
-
|
4360
|
-
|
4361
|
-
|
4904
|
+
control,
|
4905
|
+
name: "phone",
|
4906
|
+
render: ({ field }) => {
|
4907
|
+
var _a2, _b2;
|
4908
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4909
|
+
PhoneInput,
|
4910
|
+
{
|
4911
|
+
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
4912
|
+
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
4913
|
+
preferredCountry: { label: "+966" },
|
4914
|
+
...props.phoneInputProps,
|
4915
|
+
handleChange: (e) => {
|
4916
|
+
if ((0, import_libphonenumber_js2.isValidPhoneNumber)(e) && (0, import_libphonenumber_js2.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(e) === void 0) {
|
4917
|
+
let parsed = (0, import_libphonenumber_js2.parsePhoneNumber)(e);
|
4918
|
+
field.onChange(parsed.number);
|
4919
|
+
} else {
|
4920
|
+
field.onChange(e);
|
4921
|
+
}
|
4362
4922
|
}
|
4363
|
-
}
|
4364
|
-
|
4365
|
-
|
4366
|
-
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
4367
|
-
)))
|
4923
|
+
}
|
4924
|
+
);
|
4925
|
+
}
|
4368
4926
|
}
|
4369
|
-
)
|
4370
|
-
|
4371
|
-
|
4372
|
-
|
4373
|
-
|
4374
|
-
|
4375
|
-
|
4376
|
-
|
4377
|
-
|
4378
|
-
|
4927
|
+
),
|
4928
|
+
props.additionalInputs,
|
4929
|
+
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
4930
|
+
import_react_hook_form2.Controller,
|
4931
|
+
{
|
4932
|
+
control,
|
4933
|
+
name: "refCode",
|
4934
|
+
render: ({ field }) => {
|
4935
|
+
var _a2;
|
4936
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4937
|
+
Input,
|
4938
|
+
{
|
4939
|
+
width: "full",
|
4940
|
+
label: texts == null ? void 0 : texts.refCode,
|
4941
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
4942
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
4943
|
+
...field
|
4944
|
+
}
|
4945
|
+
);
|
4946
|
+
}
|
4947
|
+
}
|
4948
|
+
),
|
4949
|
+
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
4950
|
+
import_react_hook_form2.Controller,
|
4951
|
+
{
|
4952
|
+
control,
|
4953
|
+
name: "reference",
|
4954
|
+
render: ({ field }) => {
|
4955
|
+
var _a2, _b2;
|
4956
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4957
|
+
Select,
|
4958
|
+
{
|
4959
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
4960
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
4961
|
+
isCreatable: false,
|
4962
|
+
isMulti: false,
|
4963
|
+
isSearchable: false,
|
4964
|
+
isClearable: false,
|
4965
|
+
options: props.userReferenceOptions || [],
|
4966
|
+
onChange: (e) => field.onChange(e)
|
4967
|
+
}
|
4968
|
+
);
|
4969
|
+
}
|
4970
|
+
}
|
4971
|
+
)
|
4972
|
+
),
|
4973
|
+
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(
|
4974
|
+
import_react_hook_form2.Controller,
|
4379
4975
|
{
|
4380
|
-
|
4381
|
-
|
4382
|
-
|
4976
|
+
control,
|
4977
|
+
name: "terms_accepted",
|
4978
|
+
render: ({ field }) => {
|
4979
|
+
var _a2, _b2;
|
4980
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4981
|
+
Checkbox,
|
4982
|
+
{
|
4983
|
+
id: "terms_accepted",
|
4984
|
+
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
4985
|
+
onCheckedChange: (e) => field.onChange(e),
|
4986
|
+
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(
|
4987
|
+
"span",
|
4988
|
+
{
|
4989
|
+
onClick: (e) => {
|
4990
|
+
e.preventDefault();
|
4991
|
+
if (props.onRouteToTOS) {
|
4992
|
+
props.onRouteToTOS();
|
4993
|
+
}
|
4994
|
+
},
|
4995
|
+
className: "clickable-link"
|
4996
|
+
},
|
4997
|
+
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
4998
|
+
)))
|
4999
|
+
}
|
5000
|
+
);
|
5001
|
+
}
|
4383
5002
|
}
|
4384
|
-
)
|
4385
|
-
|
4386
|
-
|
4387
|
-
|
4388
|
-
|
4389
|
-
|
4390
|
-
|
4391
|
-
|
4392
|
-
|
4393
|
-
|
4394
|
-
|
4395
|
-
|
4396
|
-
|
4397
|
-
|
4398
|
-
|
4399
|
-
|
4400
|
-
|
4401
|
-
|
4402
|
-
|
4403
|
-
|
4404
|
-
|
4405
|
-
|
4406
|
-
|
4407
|
-
|
4408
|
-
|
4409
|
-
|
4410
|
-
|
4411
|
-
|
4412
|
-
|
4413
|
-
|
4414
|
-
|
4415
|
-
|
4416
|
-
|
4417
|
-
|
4418
|
-
|
4419
|
-
|
4420
|
-
|
5003
|
+
), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
|
5004
|
+
import_react_hook_form2.Controller,
|
5005
|
+
{
|
5006
|
+
control,
|
5007
|
+
name: "newsletter_accepted",
|
5008
|
+
render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
|
5009
|
+
Checkbox,
|
5010
|
+
{
|
5011
|
+
id: "newsletter_accepted",
|
5012
|
+
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
5013
|
+
onCheckedChange: field.onChange
|
5014
|
+
}
|
5015
|
+
)
|
5016
|
+
}
|
5017
|
+
)) : null
|
5018
|
+
),
|
5019
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
5020
|
+
Button,
|
5021
|
+
{
|
5022
|
+
className: "hawa-w-full",
|
5023
|
+
type: "submit",
|
5024
|
+
isLoading: props.isLoading,
|
5025
|
+
disabled: props.isLoading
|
5026
|
+
},
|
5027
|
+
(texts == null ? void 0 : texts.registerText) || "Register"
|
5028
|
+
),
|
5029
|
+
props.additionalButtons
|
5030
|
+
)),
|
5031
|
+
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"))
|
5032
|
+
)
|
5033
|
+
),
|
5034
|
+
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react37.default.createElement(
|
5035
|
+
CardFooter,
|
5036
|
+
{
|
5037
|
+
noPadding: props.cardless,
|
5038
|
+
className: cn(
|
5039
|
+
props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
|
4421
5040
|
)
|
4422
|
-
|
4423
|
-
|
4424
|
-
|
5041
|
+
},
|
5042
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
5043
|
+
AuthButtons,
|
5044
|
+
{
|
5045
|
+
texts: thirdPartyAuthTexts,
|
5046
|
+
viaGoogle: props.viaGoogle,
|
5047
|
+
viaGithub: props.viaGithub,
|
5048
|
+
viaTwitter: props.viaTwitter,
|
5049
|
+
isGoogleLoading: props.isGoogleLoading,
|
5050
|
+
isGithubLoading: props.isGithubLoading,
|
5051
|
+
isTwitterLoading: props.isTwitterLoading,
|
5052
|
+
handleGoogle: props.onGoogleRegister,
|
5053
|
+
handleGithub: props.onGithubRegister,
|
5054
|
+
handleTwitter: props.onTwitterRegister
|
5055
|
+
}
|
5056
|
+
)
|
5057
|
+
) : null
|
5058
|
+
));
|
4425
5059
|
};
|
4426
5060
|
|
4427
5061
|
// blocks/auth/AppLanding.tsx
|
4428
|
-
var
|
5062
|
+
var import_react38 = __toESM(require("react"));
|
4429
5063
|
var AppLanding = ({ texts, ...props }) => {
|
4430
5064
|
const thirdPartyAuthTexts = {
|
4431
5065
|
continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
|
@@ -4436,7 +5070,7 @@ var AppLanding = ({ texts, ...props }) => {
|
|
4436
5070
|
continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
|
4437
5071
|
continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
|
4438
5072
|
};
|
4439
|
-
return /* @__PURE__ */
|
5073
|
+
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
5074
|
AuthButtons,
|
4441
5075
|
{
|
4442
5076
|
texts: thirdPartyAuthTexts,
|
@@ -4455,7 +5089,7 @@ var AppLanding = ({ texts, ...props }) => {
|
|
4455
5089
|
handleEmail: props.handleEmail,
|
4456
5090
|
handlePhone: props.handlePhone
|
4457
5091
|
}
|
4458
|
-
), props.allowRegister && /* @__PURE__ */
|
5092
|
+
), 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
5093
|
"span",
|
4460
5094
|
{
|
4461
5095
|
onClick: props.handleRouteToRegister,
|
@@ -4466,9 +5100,9 @@ var AppLanding = ({ texts, ...props }) => {
|
|
4466
5100
|
};
|
4467
5101
|
|
4468
5102
|
// blocks/auth/CheckEmail.tsx
|
4469
|
-
var
|
5103
|
+
var import_react39 = __toESM(require("react"));
|
4470
5104
|
var CheckEmail = ({ texts, handleResend }) => {
|
4471
|
-
return /* @__PURE__ */
|
5105
|
+
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
5106
|
"svg",
|
4473
5107
|
{
|
4474
5108
|
stroke: "currentColor",
|
@@ -4481,13 +5115,13 @@ var CheckEmail = ({ texts, handleResend }) => {
|
|
4481
5115
|
width: "0.5em",
|
4482
5116
|
xmlns: "http://www.w3.org/2000/svg"
|
4483
5117
|
},
|
4484
|
-
/* @__PURE__ */
|
4485
|
-
/* @__PURE__ */
|
4486
|
-
)), /* @__PURE__ */
|
5118
|
+
/* @__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" }),
|
5119
|
+
/* @__PURE__ */ import_react39.default.createElement("polyline", { points: "22,6 12,13 2,6" })
|
5120
|
+
)), /* @__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
5121
|
};
|
4488
5122
|
|
4489
5123
|
// blocks/auth/NewPassword.tsx
|
4490
|
-
var
|
5124
|
+
var import_react40 = __toESM(require("react"));
|
4491
5125
|
var import_react_hook_form3 = require("react-hook-form");
|
4492
5126
|
var import_zod3 = require("@hookform/resolvers/zod");
|
4493
5127
|
var z3 = __toESM(require("zod"));
|
@@ -4509,7 +5143,7 @@ var NewPasswordForm = ({
|
|
4509
5143
|
const { handleSubmit, control, formState } = (0, import_react_hook_form3.useForm)({
|
4510
5144
|
resolver: (0, import_zod3.zodResolver)(formSchema)
|
4511
5145
|
});
|
4512
|
-
return /* @__PURE__ */
|
5146
|
+
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
5147
|
"form",
|
4514
5148
|
{
|
4515
5149
|
noValidate: true,
|
@@ -4523,7 +5157,7 @@ var NewPasswordForm = ({
|
|
4523
5157
|
}
|
4524
5158
|
})
|
4525
5159
|
},
|
4526
|
-
/* @__PURE__ */
|
5160
|
+
/* @__PURE__ */ import_react40.default.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col" }, props.showError && /* @__PURE__ */ import_react40.default.createElement(
|
4527
5161
|
Alert,
|
4528
5162
|
{
|
4529
5163
|
direction: props.direction,
|
@@ -4531,14 +5165,14 @@ var NewPasswordForm = ({
|
|
4531
5165
|
text: props.errorText,
|
4532
5166
|
severity: "error"
|
4533
5167
|
}
|
4534
|
-
), /* @__PURE__ */
|
5168
|
+
), /* @__PURE__ */ import_react40.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4 hawa-mb-4" }, /* @__PURE__ */ import_react40.default.createElement(
|
4535
5169
|
import_react_hook_form3.Controller,
|
4536
5170
|
{
|
4537
5171
|
control,
|
4538
5172
|
name: "password",
|
4539
5173
|
render: ({ field }) => {
|
4540
5174
|
var _a2, _b2, _c2;
|
4541
|
-
return /* @__PURE__ */
|
5175
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
4542
5176
|
Input,
|
4543
5177
|
{
|
4544
5178
|
width: "full",
|
@@ -4552,14 +5186,14 @@ var NewPasswordForm = ({
|
|
4552
5186
|
);
|
4553
5187
|
}
|
4554
5188
|
}
|
4555
|
-
), /* @__PURE__ */
|
5189
|
+
), /* @__PURE__ */ import_react40.default.createElement(
|
4556
5190
|
import_react_hook_form3.Controller,
|
4557
5191
|
{
|
4558
5192
|
control,
|
4559
5193
|
name: "confirm_password",
|
4560
5194
|
render: ({ field }) => {
|
4561
5195
|
var _a2, _b2, _c2;
|
4562
|
-
return /* @__PURE__ */
|
5196
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
4563
5197
|
Input,
|
4564
5198
|
{
|
4565
5199
|
width: "full",
|
@@ -4573,7 +5207,7 @@ var NewPasswordForm = ({
|
|
4573
5207
|
);
|
4574
5208
|
}
|
4575
5209
|
}
|
4576
|
-
)), /* @__PURE__ */
|
5210
|
+
)), /* @__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
5211
|
"span",
|
4578
5212
|
{
|
4579
5213
|
className: "clickable-link",
|
@@ -4585,7 +5219,7 @@ var NewPasswordForm = ({
|
|
4585
5219
|
};
|
4586
5220
|
|
4587
5221
|
// blocks/auth/ResetPassword.tsx
|
4588
|
-
var
|
5222
|
+
var import_react41 = __toESM(require("react"));
|
4589
5223
|
var import_react_hook_form4 = require("react-hook-form");
|
4590
5224
|
var import_zod4 = require("@hookform/resolvers/zod");
|
4591
5225
|
var z4 = __toESM(require("zod"));
|
@@ -4603,7 +5237,7 @@ var ResetPasswordForm = ({
|
|
4603
5237
|
const { handleSubmit, control, formState } = (0, import_react_hook_form4.useForm)({
|
4604
5238
|
resolver: (0, import_zod4.zodResolver)(formSchema)
|
4605
5239
|
});
|
4606
|
-
return /* @__PURE__ */
|
5240
|
+
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
5241
|
"form",
|
4608
5242
|
{
|
4609
5243
|
noValidate: true,
|
@@ -4615,7 +5249,7 @@ var ResetPasswordForm = ({
|
|
4615
5249
|
}
|
4616
5250
|
})
|
4617
5251
|
},
|
4618
|
-
/* @__PURE__ */
|
5252
|
+
/* @__PURE__ */ import_react41.default.createElement(CardContent, { headless: props.headless, className: "hawa-pb-4" }, props.showError && /* @__PURE__ */ import_react41.default.createElement(
|
4619
5253
|
Alert,
|
4620
5254
|
{
|
4621
5255
|
direction: props.direction,
|
@@ -4623,14 +5257,14 @@ var ResetPasswordForm = ({
|
|
4623
5257
|
text: props.errorText,
|
4624
5258
|
severity: "error"
|
4625
5259
|
}
|
4626
|
-
), /* @__PURE__ */
|
5260
|
+
), /* @__PURE__ */ import_react41.default.createElement(
|
4627
5261
|
import_react_hook_form4.Controller,
|
4628
5262
|
{
|
4629
5263
|
control,
|
4630
5264
|
name: "email",
|
4631
5265
|
render: ({ field }) => {
|
4632
5266
|
var _a2, _b2, _c2, _d2, _e2;
|
4633
|
-
return /* @__PURE__ */
|
5267
|
+
return /* @__PURE__ */ import_react41.default.createElement(
|
4634
5268
|
Input,
|
4635
5269
|
{
|
4636
5270
|
width: "full",
|
@@ -4646,7 +5280,7 @@ var ResetPasswordForm = ({
|
|
4646
5280
|
}
|
4647
5281
|
}
|
4648
5282
|
)),
|
4649
|
-
/* @__PURE__ */
|
5283
|
+
/* @__PURE__ */ import_react41.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ import_react41.default.createElement(
|
4650
5284
|
Button,
|
4651
5285
|
{
|
4652
5286
|
type: "submit",
|
@@ -4654,7 +5288,7 @@ var ResetPasswordForm = ({
|
|
4654
5288
|
isLoading
|
4655
5289
|
},
|
4656
5290
|
((_i = props.texts) == null ? void 0 : _i.resetPassword) || "Reset Password"
|
4657
|
-
), allowRegister && /* @__PURE__ */
|
5291
|
+
), 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
5292
|
"span",
|
4659
5293
|
{
|
4660
5294
|
className: "clickable-link",
|
@@ -4662,21 +5296,21 @@ var ResetPasswordForm = ({
|
|
4662
5296
|
},
|
4663
5297
|
(_m = (_l = props.texts) == null ? void 0 : _l.registerText) != null ? _m : "Register"
|
4664
5298
|
)))
|
4665
|
-
)) : /* @__PURE__ */
|
5299
|
+
)) : /* @__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
5300
|
};
|
4667
5301
|
|
4668
5302
|
// blocks/auth/CodeConfirmation.tsx
|
4669
|
-
var
|
5303
|
+
var import_react44 = __toESM(require("react"));
|
4670
5304
|
var import_react_hook_form5 = require("react-hook-form");
|
4671
5305
|
var import_zod5 = require("@hookform/resolvers/zod");
|
4672
5306
|
var z5 = __toESM(require("zod"));
|
4673
5307
|
|
4674
5308
|
// elements/pinInput/PinInput.tsx
|
4675
|
-
var
|
5309
|
+
var React36 = __toESM(require("react"));
|
4676
5310
|
var import_input_otp = require("input-otp");
|
4677
5311
|
|
4678
5312
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
4679
|
-
var
|
5313
|
+
var import_react43 = require("react");
|
4680
5314
|
|
4681
5315
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
4682
5316
|
var toKebabCase = (string6) => string6.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
@@ -4685,7 +5319,7 @@ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
4685
5319
|
}).join(" ");
|
4686
5320
|
|
4687
5321
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
4688
|
-
var
|
5322
|
+
var import_react42 = require("react");
|
4689
5323
|
|
4690
5324
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
4691
5325
|
var defaultAttributes = {
|
@@ -4701,7 +5335,7 @@ var defaultAttributes = {
|
|
4701
5335
|
};
|
4702
5336
|
|
4703
5337
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
4704
|
-
var Icon = (0,
|
5338
|
+
var Icon = (0, import_react42.forwardRef)(
|
4705
5339
|
({
|
4706
5340
|
color = "currentColor",
|
4707
5341
|
size = 24,
|
@@ -4712,7 +5346,7 @@ var Icon = (0, import_react22.forwardRef)(
|
|
4712
5346
|
iconNode,
|
4713
5347
|
...rest
|
4714
5348
|
}, ref) => {
|
4715
|
-
return (0,
|
5349
|
+
return (0, import_react42.createElement)(
|
4716
5350
|
"svg",
|
4717
5351
|
{
|
4718
5352
|
ref,
|
@@ -4725,7 +5359,7 @@ var Icon = (0, import_react22.forwardRef)(
|
|
4725
5359
|
...rest
|
4726
5360
|
},
|
4727
5361
|
[
|
4728
|
-
...iconNode.map(([tag, attrs]) => (0,
|
5362
|
+
...iconNode.map(([tag, attrs]) => (0, import_react42.createElement)(tag, attrs)),
|
4729
5363
|
...Array.isArray(children) ? children : [children]
|
4730
5364
|
]
|
4731
5365
|
);
|
@@ -4734,8 +5368,8 @@ var Icon = (0, import_react22.forwardRef)(
|
|
4734
5368
|
|
4735
5369
|
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
4736
5370
|
var createLucideIcon = (iconName, iconNode) => {
|
4737
|
-
const Component = (0,
|
4738
|
-
({ className, ...props }, ref) => (0,
|
5371
|
+
const Component = (0, import_react43.forwardRef)(
|
5372
|
+
({ className, ...props }, ref) => (0, import_react43.createElement)(Icon, {
|
4739
5373
|
ref,
|
4740
5374
|
iconNode,
|
4741
5375
|
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
@@ -4752,7 +5386,7 @@ var Dot = createLucideIcon("Dot", [
|
|
4752
5386
|
]);
|
4753
5387
|
|
4754
5388
|
// elements/pinInput/PinInput.tsx
|
4755
|
-
var PinInputRoot =
|
5389
|
+
var PinInputRoot = React36.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React36.createElement(
|
4756
5390
|
import_input_otp.OTPInput,
|
4757
5391
|
{
|
4758
5392
|
ref,
|
@@ -4765,12 +5399,12 @@ var PinInputRoot = React25.forwardRef(({ className, containerClassName, ...props
|
|
4765
5399
|
}
|
4766
5400
|
));
|
4767
5401
|
PinInputRoot.displayName = "PinInputRoot";
|
4768
|
-
var PinInputGroup =
|
5402
|
+
var PinInputGroup = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React36.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
|
4769
5403
|
PinInputGroup.displayName = "PinInputGroup";
|
4770
|
-
var PinInputSlot =
|
4771
|
-
const pinInputContext =
|
5404
|
+
var PinInputSlot = React36.forwardRef(({ index, className, ...props }, ref) => {
|
5405
|
+
const pinInputContext = React36.useContext(import_input_otp.OTPInputContext);
|
4772
5406
|
const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
|
4773
|
-
return /* @__PURE__ */
|
5407
|
+
return /* @__PURE__ */ React36.createElement(
|
4774
5408
|
"div",
|
4775
5409
|
{
|
4776
5410
|
ref,
|
@@ -4782,25 +5416,25 @@ var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
|
|
4782
5416
|
...props
|
4783
5417
|
},
|
4784
5418
|
char,
|
4785
|
-
hasFakeCaret && /* @__PURE__ */
|
5419
|
+
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
5420
|
);
|
4787
5421
|
});
|
4788
5422
|
PinInputSlot.displayName = "PinInputSlot";
|
4789
|
-
var PinInputSeperator =
|
5423
|
+
var PinInputSeperator = React36.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React36.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React36.createElement(Dot, null)));
|
4790
5424
|
PinInputSeperator.displayName = "PinInputSeperator";
|
4791
5425
|
var PinInput = ({ separatorPosition = 0, ...props }) => {
|
4792
5426
|
const maxLength = props.maxLength || 6;
|
4793
5427
|
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
4794
5428
|
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
4795
5429
|
const secondGroupLength = maxLength - firstGroupLength;
|
4796
|
-
return /* @__PURE__ */
|
5430
|
+
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
5431
|
PinInputSlot,
|
4798
5432
|
{
|
4799
5433
|
key: index + firstGroupLength,
|
4800
5434
|
index: index + firstGroupLength,
|
4801
5435
|
className: "hawa-w-full hawa-border"
|
4802
5436
|
}
|
4803
|
-
)))), /* @__PURE__ */
|
5437
|
+
)))), /* @__PURE__ */ React36.createElement(HelperText, { helperText: props.helperText }));
|
4804
5438
|
};
|
4805
5439
|
|
4806
5440
|
// blocks/auth/CodeConfirmation.tsx
|
@@ -4812,9 +5446,9 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4812
5446
|
const { handleSubmit, control, formState, setValue } = (0, import_react_hook_form5.useForm)({
|
4813
5447
|
resolver: (0, import_zod5.zodResolver)(formSchema)
|
4814
5448
|
});
|
4815
|
-
const [resendTimer, setResendTimer] = (0,
|
4816
|
-
const [remainingTime, setRemainingTime] = (0,
|
4817
|
-
const [showResendTimer, setShowResendTimer] = (0,
|
5449
|
+
const [resendTimer, setResendTimer] = (0, import_react44.useState)(null);
|
5450
|
+
const [remainingTime, setRemainingTime] = (0, import_react44.useState)(0);
|
5451
|
+
const [showResendTimer, setShowResendTimer] = (0, import_react44.useState)(false);
|
4818
5452
|
const startResendTimer = () => {
|
4819
5453
|
if (resendTimer !== null) {
|
4820
5454
|
clearInterval(resendTimer);
|
@@ -4836,14 +5470,14 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4836
5470
|
}, 1e3);
|
4837
5471
|
setResendTimer(newTimer);
|
4838
5472
|
};
|
4839
|
-
(0,
|
5473
|
+
(0, import_react44.useEffect)(() => {
|
4840
5474
|
return () => {
|
4841
5475
|
if (resendTimer !== null) {
|
4842
5476
|
clearInterval(resendTimer);
|
4843
5477
|
}
|
4844
5478
|
};
|
4845
5479
|
}, []);
|
4846
|
-
return /* @__PURE__ */
|
5480
|
+
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
5481
|
"form",
|
4848
5482
|
{
|
4849
5483
|
noValidate: true,
|
@@ -4855,14 +5489,14 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4855
5489
|
}
|
4856
5490
|
})
|
4857
5491
|
},
|
4858
|
-
/* @__PURE__ */
|
5492
|
+
/* @__PURE__ */ import_react44.default.createElement(
|
4859
5493
|
import_react_hook_form5.Controller,
|
4860
5494
|
{
|
4861
5495
|
control,
|
4862
5496
|
name: "otp_code",
|
4863
5497
|
render: ({ field }) => {
|
4864
5498
|
var _a2;
|
4865
|
-
return /* @__PURE__ */
|
5499
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
4866
5500
|
PinInput,
|
4867
5501
|
{
|
4868
5502
|
maxLength: codeLength,
|
@@ -4873,7 +5507,7 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4873
5507
|
}
|
4874
5508
|
}
|
4875
5509
|
),
|
4876
|
-
showResendTimer ? /* @__PURE__ */
|
5510
|
+
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
5511
|
"span",
|
4878
5512
|
{
|
4879
5513
|
className: "clickable-link",
|
@@ -4884,7 +5518,7 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4884
5518
|
},
|
4885
5519
|
((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
|
4886
5520
|
)),
|
4887
|
-
/* @__PURE__ */
|
5521
|
+
/* @__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
5522
|
Button,
|
4889
5523
|
{
|
4890
5524
|
type: "button",
|
@@ -4898,7 +5532,7 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
4898
5532
|
variant: "outline"
|
4899
5533
|
},
|
4900
5534
|
((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"
|
4901
|
-
), /* @__PURE__ */
|
5535
|
+
), /* @__PURE__ */ import_react44.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
|
4902
5536
|
)));
|
4903
5537
|
};
|
4904
5538
|
// Annotate the CommonJS export names for ESM import in node:
|