warqadui 0.0.298 → 0.0.299

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/index.mjs CHANGED
@@ -1,7 +1,3 @@
1
- import {
2
- __export
3
- } from "./chunk-7P6ASYW6.mjs";
4
-
5
1
  // src/components/Button.tsx
6
2
  import React3 from "react";
7
3
 
@@ -51796,14 +51792,1397 @@ var ProductList2 = ({ value = false }) => {
51796
51792
  };
51797
51793
  var ProductList_default = ProductList2;
51798
51794
 
51799
- // src/Antd/inputs/index.tsx
51800
- var inputs_exports = {};
51801
- __export(inputs_exports, {
51802
- AntdInputs: () => AntdInputs
51803
- });
51804
- var AntdInputs = {
51805
- ...inputs_exports
51795
+ // src/Antd/inputs/FormField.tsx
51796
+ import { AlertCircle as AlertCircle30 } from "lucide-react";
51797
+ import { jsx as jsx281, jsxs as jsxs250 } from "react/jsx-runtime";
51798
+ var FormField = ({
51799
+ label,
51800
+ id,
51801
+ required,
51802
+ error,
51803
+ hint,
51804
+ topRight,
51805
+ className = "",
51806
+ children
51807
+ }) => {
51808
+ const errorMessage = typeof error === "string" ? error : null;
51809
+ return /* @__PURE__ */ jsxs250("div", { className: `space-y-1.5 ${className}`, children: [
51810
+ (label || topRight) && /* @__PURE__ */ jsxs250("div", { className: "flex items-center justify-between text-xs font-semibold text-zinc-700 dark:text-zinc-300", children: [
51811
+ label && /* @__PURE__ */ jsxs250("label", { htmlFor: id, className: "flex items-center gap-1", children: [
51812
+ /* @__PURE__ */ jsx281("span", { children: label }),
51813
+ required && /* @__PURE__ */ jsx281("span", { className: "text-rose-500", children: "*" })
51814
+ ] }),
51815
+ topRight && /* @__PURE__ */ jsx281("div", { className: "text-[11px] font-normal text-zinc-400", children: topRight })
51816
+ ] }),
51817
+ children,
51818
+ errorMessage && /* @__PURE__ */ jsxs250("div", { className: "flex items-center gap-1.5 text-[11px] text-rose-600 dark:text-rose-400 font-medium pt-0.5 animate-in fade-in duration-150", children: [
51819
+ /* @__PURE__ */ jsx281(AlertCircle30, { size: 13, className: "shrink-0 text-rose-500" }),
51820
+ /* @__PURE__ */ jsx281("span", { children: errorMessage })
51821
+ ] }),
51822
+ !errorMessage && hint && /* @__PURE__ */ jsx281("p", { className: "text-[11px] text-zinc-400 dark:text-zinc-500 pt-0.5 leading-relaxed", children: hint })
51823
+ ] });
51824
+ };
51825
+ var FormField_default = FormField;
51826
+
51827
+ // src/Antd/inputs/TextInput.tsx
51828
+ import { forwardRef as forwardRef10, useState as useState123, useEffect as useEffect120 } from "react";
51829
+ import { Eye as Eye28, EyeOff as EyeOff3 } from "lucide-react";
51830
+ import { useController } from "react-hook-form";
51831
+
51832
+ // src/Antd/inputs/types.ts
51833
+ import { useFormContext as useFormContext13 } from "react-hook-form";
51834
+ function getFormFieldError(name, methodsOrForm, manualError) {
51835
+ if (typeof manualError === "string") return manualError;
51836
+ if (!methodsOrForm || !name) return null;
51837
+ const errors = methodsOrForm.formState?.errors || methodsOrForm.errors;
51838
+ if (!errors) return null;
51839
+ const nameParts = String(name).split(".");
51840
+ let currentError = errors;
51841
+ for (const part of nameParts) {
51842
+ currentError = currentError?.[part];
51843
+ }
51844
+ return currentError?.message || null;
51845
+ }
51846
+ function useFormInstance(methods, form) {
51847
+ if (methods) return methods;
51848
+ if (form) return form;
51849
+ try {
51850
+ const context = useFormContext13();
51851
+ return context || null;
51852
+ } catch {
51853
+ return null;
51854
+ }
51855
+ }
51856
+
51857
+ // src/Antd/inputs/TextInput.tsx
51858
+ import { jsx as jsx282, jsxs as jsxs251 } from "react/jsx-runtime";
51859
+ var RHFInput = forwardRef10(
51860
+ ({ activeForm, name, value, onChange, onBlur, ...rest }, ref2) => {
51861
+ const { field } = useController({
51862
+ name,
51863
+ control: activeForm.control,
51864
+ defaultValue: value ?? ""
51865
+ });
51866
+ return /* @__PURE__ */ jsx282(
51867
+ "input",
51868
+ {
51869
+ ...rest,
51870
+ name: field.name,
51871
+ value: value !== void 0 ? value : field.value ?? "",
51872
+ onChange: (e) => {
51873
+ field.onChange(e);
51874
+ onChange?.(e);
51875
+ },
51876
+ onBlur: (e) => {
51877
+ field.onBlur();
51878
+ onBlur?.(e);
51879
+ },
51880
+ ref: (node) => {
51881
+ field.ref(node);
51882
+ if (typeof ref2 === "function") ref2(node);
51883
+ else if (ref2) ref2.current = node;
51884
+ }
51885
+ }
51886
+ );
51887
+ }
51888
+ );
51889
+ RHFInput.displayName = "RHFInput";
51890
+ var TextInput = forwardRef10(
51891
+ ({
51892
+ label,
51893
+ name,
51894
+ methods,
51895
+ form,
51896
+ id,
51897
+ required,
51898
+ disabled,
51899
+ readOnly,
51900
+ error,
51901
+ hint,
51902
+ topRight,
51903
+ icon,
51904
+ rightIcon,
51905
+ prefix,
51906
+ suffix,
51907
+ placeholder,
51908
+ className = "",
51909
+ inputClassName = "",
51910
+ containerClassName = "",
51911
+ size = "md",
51912
+ type = "text",
51913
+ value,
51914
+ onChange,
51915
+ onFocus,
51916
+ onBlur,
51917
+ ...rest
51918
+ }, ref2) => {
51919
+ const [showPassword, setShowPassword] = useState123(false);
51920
+ const activeForm = useFormInstance(methods, form);
51921
+ const inputId = id || name || (label ? String(label).toLowerCase().replace(/\s+/g, "-") : void 0);
51922
+ const errorMessage = getFormFieldError(name, activeForm, error);
51923
+ const hasError = Boolean(errorMessage);
51924
+ const sizeHeightClass = size === "sm" ? "h-8 text-xs" : size === "lg" ? "h-12 text-sm" : "h-10 text-xs";
51925
+ const watchedValue = activeForm?.watch?.(name);
51926
+ useEffect120(() => {
51927
+ if (activeForm && name && activeForm.formState?.errors?.root) {
51928
+ activeForm.clearErrors("root");
51929
+ }
51930
+ }, [watchedValue, name, activeForm]);
51931
+ const actualType = type === "password" ? showPassword ? "text" : "password" : type;
51932
+ const commonInputClasses = `w-full rounded-xl border font-normal transition-all placeholder:text-zinc-400 dark:placeholder:text-zinc-500 ${sizeHeightClass} ${icon ? "pl-9" : prefix ? "pl-3 rounded-l-none" : "pl-3"} ${type === "password" || rightIcon ? "pr-9" : suffix ? "pr-3 rounded-r-none" : "pr-3"} ${hasError ? "border-rose-400 dark:border-rose-800 bg-rose-50/20 dark:bg-rose-950/20 text-rose-900 dark:text-rose-200 focus:outline-none focus:ring-2 focus:ring-rose-500/20 focus:border-rose-500" : "border-zinc-200 dark:border-zinc-700 bg-zinc-50/50 dark:bg-zinc-800/60 text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-emerald-500/20 focus:border-emerald-500"} ${disabled ? "opacity-60 cursor-not-allowed bg-zinc-100 dark:bg-zinc-800/40" : ""} ${inputClassName}`;
51933
+ return /* @__PURE__ */ jsx282(
51934
+ FormField_default,
51935
+ {
51936
+ label,
51937
+ id: inputId,
51938
+ required,
51939
+ error: errorMessage,
51940
+ hint,
51941
+ topRight,
51942
+ className,
51943
+ children: /* @__PURE__ */ jsxs251("div", { className: `relative flex items-center ${containerClassName}`, children: [
51944
+ prefix && /* @__PURE__ */ jsx282("div", { className: "inline-flex items-center px-3 h-full border border-r-0 border-zinc-200 dark:border-zinc-700 bg-zinc-100/70 dark:bg-zinc-800 text-zinc-500 text-xs rounded-l-xl select-none shrink-0", children: prefix }),
51945
+ icon && /* @__PURE__ */ jsx282("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-zinc-400", children: icon }),
51946
+ activeForm && name ? /* @__PURE__ */ jsx282(
51947
+ RHFInput,
51948
+ {
51949
+ ref: ref2,
51950
+ activeForm,
51951
+ name,
51952
+ id: inputId,
51953
+ type: actualType,
51954
+ disabled,
51955
+ readOnly,
51956
+ placeholder,
51957
+ onFocus,
51958
+ onBlur,
51959
+ className: commonInputClasses,
51960
+ value,
51961
+ onChange,
51962
+ ...rest
51963
+ }
51964
+ ) : /* @__PURE__ */ jsx282(
51965
+ "input",
51966
+ {
51967
+ ref: ref2,
51968
+ id: inputId,
51969
+ name,
51970
+ type: actualType,
51971
+ disabled,
51972
+ readOnly,
51973
+ placeholder,
51974
+ onFocus,
51975
+ onBlur,
51976
+ value: value !== void 0 ? value : "",
51977
+ onChange,
51978
+ className: commonInputClasses,
51979
+ ...rest
51980
+ }
51981
+ ),
51982
+ type === "password" && /* @__PURE__ */ jsx282(
51983
+ "button",
51984
+ {
51985
+ type: "button",
51986
+ onClick: () => setShowPassword(!showPassword),
51987
+ className: "absolute inset-y-0 right-0 pr-3 flex items-center text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 transition-colors focus:outline-none cursor-pointer",
51988
+ tabIndex: -1,
51989
+ children: showPassword ? /* @__PURE__ */ jsx282(EyeOff3, { size: 15 }) : /* @__PURE__ */ jsx282(Eye28, { size: 15 })
51990
+ }
51991
+ ),
51992
+ type !== "password" && rightIcon && /* @__PURE__ */ jsx282("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-zinc-400", children: rightIcon }),
51993
+ suffix && /* @__PURE__ */ jsx282("div", { className: "inline-flex items-center px-3 h-full border border-l-0 border-zinc-200 dark:border-zinc-700 bg-zinc-100/70 dark:bg-zinc-800 text-zinc-500 text-xs rounded-r-xl select-none shrink-0", children: suffix })
51994
+ ] })
51995
+ }
51996
+ );
51997
+ }
51998
+ );
51999
+ TextInput.displayName = "TextInput";
52000
+ var TextInput_default = TextInput;
52001
+
52002
+ // src/Antd/inputs/EmailInput.tsx
52003
+ import { forwardRef as forwardRef11, useMemo as useMemo58 } from "react";
52004
+ import { Mail as Mail12 } from "lucide-react";
52005
+ import { jsx as jsx283 } from "react/jsx-runtime";
52006
+ var EmailInput = forwardRef11(
52007
+ ({
52008
+ name,
52009
+ methods,
52010
+ form,
52011
+ icon = /* @__PURE__ */ jsx283(Mail12, { size: 15 }),
52012
+ placeholder = "e.g. name@example.com",
52013
+ validateFormat = true,
52014
+ error,
52015
+ value,
52016
+ ...rest
52017
+ }, ref2) => {
52018
+ const activeForm = useFormInstance(methods, form);
52019
+ const rhfError = getFormFieldError(name, activeForm, error);
52020
+ const computedError = useMemo58(() => {
52021
+ if (rhfError) return rhfError;
52022
+ if (!validateFormat || activeForm) return null;
52023
+ const strVal = typeof value === "string" ? value.trim() : "";
52024
+ if (!strVal) return null;
52025
+ const isValidEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(strVal);
52026
+ if (!isValidEmail) {
52027
+ return "Please enter a valid email address (e.g. customer@example.com)";
52028
+ }
52029
+ return null;
52030
+ }, [rhfError, validateFormat, activeForm, value]);
52031
+ return /* @__PURE__ */ jsx283(
52032
+ TextInput_default,
52033
+ {
52034
+ ref: ref2,
52035
+ name,
52036
+ methods,
52037
+ form,
52038
+ type: "email",
52039
+ autoComplete: "email",
52040
+ icon,
52041
+ placeholder,
52042
+ error: computedError,
52043
+ value,
52044
+ ...rest
52045
+ }
52046
+ );
52047
+ }
52048
+ );
52049
+ EmailInput.displayName = "EmailInput";
52050
+
52051
+ // src/Antd/inputs/PhoneInput.tsx
52052
+ import { forwardRef as forwardRef12 } from "react";
52053
+ import PhoneInputOriginal2, {
52054
+ isValidPhoneNumber as rawIsValidPhoneNumber
52055
+ } from "react-phone-number-input";
52056
+ import "react-phone-number-input/style.css";
52057
+ import { Controller as Controller8 } from "react-hook-form";
52058
+ import { jsx as jsx284, jsxs as jsxs252 } from "react/jsx-runtime";
52059
+ var isValidPhoneNumber2 = (phone) => {
52060
+ if (!phone || typeof phone !== "string" || !phone.trim()) return false;
52061
+ try {
52062
+ return rawIsValidPhoneNumber(phone.trim());
52063
+ } catch (e) {
52064
+ return false;
52065
+ }
52066
+ };
52067
+ var PhoneInput2 = forwardRef12(
52068
+ ({
52069
+ label = "Phone Number",
52070
+ id,
52071
+ name,
52072
+ methods,
52073
+ form,
52074
+ required,
52075
+ disabled,
52076
+ readOnly,
52077
+ error,
52078
+ hint,
52079
+ topRight,
52080
+ icon,
52081
+ placeholder = "e.g. 712 345 678",
52082
+ className = "",
52083
+ inputClassName = "",
52084
+ containerClassName = "",
52085
+ value,
52086
+ onChange,
52087
+ defaultCountry = "KE",
52088
+ international = true,
52089
+ withCountryCallingCode = true,
52090
+ ...props
52091
+ }, ref2) => {
52092
+ const activeForm = useFormInstance(methods, form);
52093
+ const inputId = id || name || "phone-input";
52094
+ const errorMessage = getFormFieldError(name, activeForm, error);
52095
+ const hasError = Boolean(errorMessage);
52096
+ const renderInput = (onChangeHandler, currentValue) => /* @__PURE__ */ jsx284(
52097
+ FormField_default,
52098
+ {
52099
+ label,
52100
+ id: inputId,
52101
+ required,
52102
+ error: errorMessage,
52103
+ hint,
52104
+ topRight,
52105
+ className,
52106
+ children: /* @__PURE__ */ jsxs252("div", { className: `relative ${containerClassName}`, children: [
52107
+ icon && /* @__PURE__ */ jsx284("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none z-10 text-zinc-400", children: icon }),
52108
+ /* @__PURE__ */ jsx284(
52109
+ PhoneInputOriginal2,
52110
+ {
52111
+ ref: ref2,
52112
+ id: inputId,
52113
+ name,
52114
+ defaultCountry,
52115
+ international,
52116
+ withCountryCallingCode,
52117
+ value: currentValue,
52118
+ onChange: (val) => onChangeHandler(val ? String(val) : ""),
52119
+ disabled: disabled || readOnly,
52120
+ placeholder,
52121
+ className: `flex items-center w-full h-10 rounded-xl border bg-zinc-50/50 dark:bg-zinc-800/60 text-zinc-900 dark:text-zinc-100 transition-all font-mono text-xs ${icon ? "pl-9" : "pl-3"} pr-3 ${hasError ? "border-rose-400 dark:border-rose-800 bg-rose-50/20 dark:bg-rose-950/20 text-rose-900 dark:text-rose-200 focus-within:ring-2 focus-within:ring-rose-500/20 focus-within:border-rose-500" : "border-zinc-200 dark:border-zinc-700 focus-within:ring-2 focus-within:ring-emerald-500/20 focus-within:border-emerald-500"} ${disabled ? "opacity-60 cursor-not-allowed bg-zinc-100 dark:bg-zinc-800/40" : ""} [&_.PhoneInputCountry]:mr-2.5 [&_.PhoneInputCountry]:flex [&_.PhoneInputCountry]:items-center [&_.PhoneInputCountryIcon]:rounded-xs [&_.PhoneInputCountryIcon]:shadow-xs [&_.PhoneInputCountrySelect]:cursor-pointer [&_.PhoneInputCountrySelectArrow]:text-zinc-400 [&_.PhoneInputCountrySelectArrow]:opacity-70 [&_.PhoneInputInput]:bg-transparent [&_.PhoneInputInput]:border-none [&_.PhoneInputInput]:outline-none [&_.PhoneInputInput]:text-xs [&_.PhoneInputInput]:font-mono [&_.PhoneInputInput]:text-zinc-900 [&_.PhoneInputInput]:dark:text-zinc-100 [&_.PhoneInputInput::placeholder]:text-zinc-400 [&_.PhoneInputInput]:w-full [&_.PhoneInputInput]:h-full [&_.PhoneInputInput]:focus:ring-0 ${inputClassName}`,
52122
+ ...props
52123
+ }
52124
+ )
52125
+ ] })
52126
+ }
52127
+ );
52128
+ if (activeForm && name) {
52129
+ return /* @__PURE__ */ jsx284(
52130
+ Controller8,
52131
+ {
52132
+ name,
52133
+ control: activeForm.control,
52134
+ rules: {
52135
+ validate: (val) => !val || isValidPhoneNumber2(val) ? true : "Invalid phone number"
52136
+ },
52137
+ render: ({ field: { onChange: fieldOnChange, value: fieldValue } }) => renderInput(
52138
+ (val) => {
52139
+ fieldOnChange(val);
52140
+ onChange?.(val);
52141
+ },
52142
+ fieldValue || ""
52143
+ )
52144
+ }
52145
+ );
52146
+ }
52147
+ return renderInput(onChange || (() => {
52148
+ }), value || "");
52149
+ }
52150
+ );
52151
+ PhoneInput2.displayName = "PhoneInput";
52152
+
52153
+ // src/Antd/inputs/NumberInput.tsx
52154
+ import { forwardRef as forwardRef13 } from "react";
52155
+ import { ChevronUp as ChevronUp2, ChevronDown as ChevronDown7 } from "lucide-react";
52156
+ import { Controller as Controller9 } from "react-hook-form";
52157
+ import { jsx as jsx285, jsxs as jsxs253 } from "react/jsx-runtime";
52158
+ var NumberInput = forwardRef13(
52159
+ ({
52160
+ label,
52161
+ id,
52162
+ name,
52163
+ methods,
52164
+ form,
52165
+ required,
52166
+ disabled,
52167
+ readOnly,
52168
+ error,
52169
+ hint,
52170
+ topRight,
52171
+ icon,
52172
+ rightIcon,
52173
+ prefix,
52174
+ suffix,
52175
+ placeholder = "0",
52176
+ className = "",
52177
+ inputClassName = "",
52178
+ containerClassName = "",
52179
+ size = "md",
52180
+ value,
52181
+ onChange,
52182
+ min,
52183
+ max,
52184
+ step = 1,
52185
+ allowDecimals = true,
52186
+ showControls = false,
52187
+ formatSeparators = false,
52188
+ ...rest
52189
+ }, ref2) => {
52190
+ const activeForm = useFormInstance(methods, form);
52191
+ const inputId = id || name || (label ? String(label).toLowerCase().replace(/\s+/g, "-") : void 0);
52192
+ const errorMessage = getFormFieldError(name, activeForm, error);
52193
+ const hasError = Boolean(errorMessage);
52194
+ const sizeHeightClass = size === "sm" ? "h-8 text-xs" : size === "lg" ? "h-12 text-sm" : "h-10 text-xs";
52195
+ const formatDisplay = (val) => {
52196
+ if (val === void 0 || val === null || val === "") return "";
52197
+ if (formatSeparators) {
52198
+ return String(val).split(".").map(
52199
+ (part, idx) => idx === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part
52200
+ ).join(".");
52201
+ }
52202
+ return String(val);
52203
+ };
52204
+ const renderInput = (inputRef, currentValue, onValueChange, onInputBlur) => {
52205
+ const displayVal = formatDisplay(currentValue);
52206
+ const handleChange = (e) => {
52207
+ const rawVal = e.target.value.replace(/,/g, "").trim();
52208
+ if (rawVal === "" || rawVal === "-") {
52209
+ onValueChange(void 0, rawVal);
52210
+ return;
52211
+ }
52212
+ const regex = allowDecimals ? /^-?\d*\.?\d*$/ : /^-?\d*$/;
52213
+ if (!regex.test(rawVal)) {
52214
+ return;
52215
+ }
52216
+ const parsed = allowDecimals ? parseFloat(rawVal) : parseInt(rawVal, 10);
52217
+ onValueChange(isNaN(parsed) ? void 0 : parsed, rawVal);
52218
+ };
52219
+ const handleStep = (delta) => {
52220
+ if (disabled || readOnly) return;
52221
+ const current = typeof currentValue === "number" ? currentValue : parseFloat(String(currentValue || 0).replace(/,/g, "")) || 0;
52222
+ let nextVal = current + delta * step;
52223
+ if (min !== void 0 && nextVal < min) nextVal = min;
52224
+ if (max !== void 0 && nextVal > max) nextVal = max;
52225
+ const rounded = allowDecimals ? parseFloat(nextVal.toFixed(6)) : Math.round(nextVal);
52226
+ onValueChange(rounded, String(rounded));
52227
+ };
52228
+ return /* @__PURE__ */ jsx285(
52229
+ FormField_default,
52230
+ {
52231
+ label,
52232
+ id: inputId,
52233
+ required,
52234
+ error: errorMessage,
52235
+ hint,
52236
+ topRight,
52237
+ className,
52238
+ children: /* @__PURE__ */ jsxs253("div", { className: `relative flex items-center ${containerClassName}`, children: [
52239
+ prefix && /* @__PURE__ */ jsx285("div", { className: "inline-flex items-center px-3 h-full border border-r-0 border-zinc-200 dark:border-zinc-700 bg-zinc-100/70 dark:bg-zinc-800 text-zinc-500 text-xs rounded-l-xl select-none shrink-0", children: prefix }),
52240
+ icon && /* @__PURE__ */ jsx285("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-zinc-400", children: icon }),
52241
+ /* @__PURE__ */ jsx285(
52242
+ "input",
52243
+ {
52244
+ ref: inputRef || ref2,
52245
+ id: inputId,
52246
+ name,
52247
+ type: "text",
52248
+ inputMode: allowDecimals ? "decimal" : "numeric",
52249
+ value: displayVal,
52250
+ onChange: handleChange,
52251
+ onBlur: onInputBlur,
52252
+ disabled,
52253
+ readOnly,
52254
+ placeholder,
52255
+ className: `w-full rounded-xl border font-mono transition-all placeholder:text-zinc-400 ${sizeHeightClass} ${icon ? "pl-9" : prefix ? "pl-3 rounded-l-none" : "pl-3"} ${showControls ? "pr-8" : rightIcon ? "pr-9" : suffix ? "pr-3 rounded-r-none" : "pr-3"} ${hasError ? "border-rose-400 dark:border-rose-800 bg-rose-50/20 dark:bg-rose-950/20 text-rose-900 dark:text-rose-200 focus:outline-none focus:ring-2 focus:ring-rose-500/20 focus:border-rose-500" : "border-zinc-200 dark:border-zinc-700 bg-zinc-50/50 dark:bg-zinc-800/60 text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-emerald-500/20 focus:border-emerald-500"} ${disabled ? "opacity-60 cursor-not-allowed bg-zinc-100 dark:bg-zinc-800/40" : ""} ${inputClassName}`,
52256
+ ...rest
52257
+ }
52258
+ ),
52259
+ showControls && !disabled && !readOnly && /* @__PURE__ */ jsxs253("div", { className: "absolute inset-y-1 right-1 flex flex-col justify-between w-6 border-l border-zinc-200 dark:border-zinc-700 pl-1", children: [
52260
+ /* @__PURE__ */ jsx285(
52261
+ "button",
52262
+ {
52263
+ type: "button",
52264
+ tabIndex: -1,
52265
+ onClick: () => handleStep(1),
52266
+ className: "flex-1 flex items-center justify-center text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-xs cursor-pointer",
52267
+ children: /* @__PURE__ */ jsx285(ChevronUp2, { size: 11 })
52268
+ }
52269
+ ),
52270
+ /* @__PURE__ */ jsx285(
52271
+ "button",
52272
+ {
52273
+ type: "button",
52274
+ tabIndex: -1,
52275
+ onClick: () => handleStep(-1),
52276
+ className: "flex-1 flex items-center justify-center text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-xs cursor-pointer",
52277
+ children: /* @__PURE__ */ jsx285(ChevronDown7, { size: 11 })
52278
+ }
52279
+ )
52280
+ ] }),
52281
+ !showControls && rightIcon && /* @__PURE__ */ jsx285("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-zinc-400", children: rightIcon }),
52282
+ suffix && /* @__PURE__ */ jsx285("div", { className: "inline-flex items-center px-3 h-full border border-l-0 border-zinc-200 dark:border-zinc-700 bg-zinc-100/70 dark:bg-zinc-800 text-zinc-500 text-xs rounded-r-xl select-none shrink-0", children: suffix })
52283
+ ] })
52284
+ }
52285
+ );
52286
+ };
52287
+ if (activeForm && name) {
52288
+ return /* @__PURE__ */ jsx285(
52289
+ Controller9,
52290
+ {
52291
+ control: activeForm.control,
52292
+ name,
52293
+ render: ({
52294
+ field: {
52295
+ onChange: fieldOnChange,
52296
+ value: fieldValue,
52297
+ ref: fieldRef,
52298
+ onBlur: fieldOnBlur
52299
+ }
52300
+ }) => renderInput(
52301
+ fieldRef,
52302
+ fieldValue !== void 0 ? fieldValue : value !== void 0 ? value : "",
52303
+ (numVal, rawStr) => {
52304
+ fieldOnChange(numVal !== void 0 ? numVal : "");
52305
+ onChange?.(numVal, rawStr);
52306
+ },
52307
+ fieldOnBlur
52308
+ )
52309
+ }
52310
+ );
52311
+ }
52312
+ return renderInput(
52313
+ ref2,
52314
+ value !== void 0 ? value : "",
52315
+ (numVal, rawStr) => {
52316
+ onChange?.(numVal, rawStr);
52317
+ }
52318
+ );
52319
+ }
52320
+ );
52321
+ NumberInput.displayName = "NumberInput";
52322
+
52323
+ // src/Antd/inputs/AmountInput.tsx
52324
+ import { forwardRef as forwardRef14, useState as useState124, useEffect as useEffect121 } from "react";
52325
+ import { Controller as Controller10 } from "react-hook-form";
52326
+ import { jsx as jsx286, jsxs as jsxs254 } from "react/jsx-runtime";
52327
+ var AmountInput = forwardRef14(
52328
+ ({
52329
+ label,
52330
+ id,
52331
+ name,
52332
+ methods,
52333
+ form,
52334
+ required,
52335
+ disabled,
52336
+ readOnly,
52337
+ error,
52338
+ hint,
52339
+ topRight,
52340
+ icon,
52341
+ rightIcon,
52342
+ suffix,
52343
+ placeholder = "0.00",
52344
+ className = "",
52345
+ inputClassName = "",
52346
+ containerClassName = "",
52347
+ size = "md",
52348
+ value,
52349
+ onChange,
52350
+ currency = "KES",
52351
+ currencyPosition = "prefix",
52352
+ decimals = 2,
52353
+ allowNegative = false,
52354
+ min,
52355
+ max,
52356
+ formatSeparators = true,
52357
+ ...rest
52358
+ }, ref2) => {
52359
+ const activeForm = useFormInstance(methods, form);
52360
+ const inputId = id || name || (label ? String(label).toLowerCase().replace(/\s+/g, "-") : void 0);
52361
+ const errorMessage = getFormFieldError(name, activeForm, error);
52362
+ const hasError = Boolean(errorMessage);
52363
+ const formatNumber = (val) => {
52364
+ if (val === void 0 || val === null || val === "") return "";
52365
+ const num = typeof val === "number" ? val : parseFloat(String(val).replace(/,/g, ""));
52366
+ if (isNaN(num)) return "";
52367
+ if (formatSeparators) {
52368
+ return num.toLocaleString("en-US", {
52369
+ minimumFractionDigits: 0,
52370
+ maximumFractionDigits: decimals
52371
+ });
52372
+ }
52373
+ return String(num);
52374
+ };
52375
+ const sizeHeightClass = size === "sm" ? "h-8 text-xs" : size === "lg" ? "h-12 text-sm" : "h-10 text-xs";
52376
+ const currencyBadge = currency ? /* @__PURE__ */ jsx286("span", { className: "font-semibold text-zinc-600 dark:text-zinc-300 font-mono text-[11px] tracking-wide", children: currency }) : null;
52377
+ const renderInput = (inputRef, currentValue, onValueChange, onInputBlur) => {
52378
+ const [isFocused, setIsFocused] = useState124(false);
52379
+ const [displayValue, setDisplayValue] = useState124(
52380
+ () => formatNumber(currentValue)
52381
+ );
52382
+ useEffect121(() => {
52383
+ if (!isFocused) {
52384
+ setDisplayValue(formatNumber(currentValue));
52385
+ }
52386
+ }, [currentValue, isFocused]);
52387
+ const handleFocus = () => {
52388
+ setIsFocused(true);
52389
+ if (currentValue !== void 0 && currentValue !== "") {
52390
+ setDisplayValue(String(currentValue).replace(/,/g, ""));
52391
+ }
52392
+ };
52393
+ const handleBlur = () => {
52394
+ setIsFocused(false);
52395
+ setDisplayValue(formatNumber(currentValue));
52396
+ onInputBlur?.();
52397
+ };
52398
+ const handleChange = (e) => {
52399
+ let rawVal = e.target.value.replace(/,/g, "").trim();
52400
+ if (rawVal === "" || allowNegative && rawVal === "-") {
52401
+ setDisplayValue(rawVal);
52402
+ onValueChange(void 0, rawVal);
52403
+ return;
52404
+ }
52405
+ const regex = allowNegative ? decimals > 0 ? /^-?\d*\.?\d*$/ : /^-?\d*$/ : decimals > 0 ? /^\d*\.?\d*$/ : /^\d*$/;
52406
+ if (!regex.test(rawVal)) {
52407
+ return;
52408
+ }
52409
+ if (decimals > 0 && rawVal.includes(".")) {
52410
+ const parts = rawVal.split(".");
52411
+ if (parts[1].length > decimals) {
52412
+ rawVal = `${parts[0]}.${parts[1].slice(0, decimals)}`;
52413
+ }
52414
+ }
52415
+ setDisplayValue(rawVal);
52416
+ const parsed = parseFloat(rawVal);
52417
+ if (!isNaN(parsed)) {
52418
+ let finalNum = parsed;
52419
+ if (min !== void 0 && finalNum < min) finalNum = min;
52420
+ if (max !== void 0 && finalNum > max) finalNum = max;
52421
+ onValueChange(finalNum, rawVal);
52422
+ } else {
52423
+ onValueChange(void 0, rawVal);
52424
+ }
52425
+ };
52426
+ return /* @__PURE__ */ jsx286(
52427
+ FormField_default,
52428
+ {
52429
+ label,
52430
+ id: inputId,
52431
+ required,
52432
+ error: errorMessage,
52433
+ hint,
52434
+ topRight,
52435
+ className,
52436
+ children: /* @__PURE__ */ jsxs254("div", { className: `relative flex items-center ${containerClassName}`, children: [
52437
+ currencyPosition === "prefix" && currencyBadge && /* @__PURE__ */ jsx286("div", { className: "inline-flex items-center px-3 h-10 border border-r-0 border-zinc-200 dark:border-zinc-700 bg-zinc-100/70 dark:bg-zinc-800 rounded-l-xl select-none shrink-0", children: currencyBadge }),
52438
+ icon && /* @__PURE__ */ jsx286("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-zinc-400", children: icon }),
52439
+ /* @__PURE__ */ jsx286(
52440
+ "input",
52441
+ {
52442
+ ref: inputRef || ref2,
52443
+ id: inputId,
52444
+ name,
52445
+ type: "text",
52446
+ inputMode: "decimal",
52447
+ value: displayValue,
52448
+ onChange: handleChange,
52449
+ onFocus: handleFocus,
52450
+ onBlur: handleBlur,
52451
+ disabled,
52452
+ readOnly,
52453
+ placeholder,
52454
+ className: `w-full rounded-xl border font-mono font-medium transition-all placeholder:text-zinc-400 ${sizeHeightClass} ${icon ? "pl-9" : currencyPosition === "prefix" && currencyBadge ? "pl-3 rounded-l-none" : "pl-3"} ${rightIcon ? "pr-9" : currencyPosition === "suffix" && currencyBadge ? "pr-3 rounded-r-none" : suffix ? "pr-3 rounded-r-none" : "pr-3"} ${hasError ? "border-rose-400 dark:border-rose-800 bg-rose-50/20 dark:bg-rose-950/20 text-rose-900 dark:text-rose-200 focus:outline-none focus:ring-2 focus:ring-rose-500/20 focus:border-rose-500" : "border-zinc-200 dark:border-zinc-700 bg-zinc-50/50 dark:bg-zinc-800/60 text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-emerald-500/20 focus:border-emerald-500"} ${disabled ? "opacity-60 cursor-not-allowed bg-zinc-100 dark:bg-zinc-800/40" : ""} ${inputClassName}`,
52455
+ ...rest
52456
+ }
52457
+ ),
52458
+ rightIcon && /* @__PURE__ */ jsx286("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-zinc-400", children: rightIcon }),
52459
+ currencyPosition === "suffix" && currencyBadge && /* @__PURE__ */ jsx286("div", { className: "inline-flex items-center px-3 h-10 border border-l-0 border-zinc-200 dark:border-zinc-700 bg-zinc-100/70 dark:bg-zinc-800 rounded-r-xl select-none shrink-0", children: currencyBadge }),
52460
+ suffix && !currencyBadge && /* @__PURE__ */ jsx286("div", { className: "inline-flex items-center px-3 h-10 border border-l-0 border-zinc-200 dark:border-zinc-700 bg-zinc-100/70 dark:bg-zinc-800 text-zinc-500 text-xs rounded-r-xl select-none shrink-0", children: suffix })
52461
+ ] })
52462
+ }
52463
+ );
52464
+ };
52465
+ if (activeForm && name) {
52466
+ return /* @__PURE__ */ jsx286(
52467
+ Controller10,
52468
+ {
52469
+ control: activeForm.control,
52470
+ name,
52471
+ render: ({
52472
+ field: {
52473
+ onChange: fieldOnChange,
52474
+ value: fieldValue,
52475
+ ref: fieldRef,
52476
+ onBlur: fieldOnBlur
52477
+ }
52478
+ }) => renderInput(
52479
+ fieldRef,
52480
+ fieldValue !== void 0 ? fieldValue : value !== void 0 ? value : "",
52481
+ (numVal, rawStr) => {
52482
+ fieldOnChange(numVal !== void 0 ? numVal : "");
52483
+ onChange?.(numVal, rawStr);
52484
+ },
52485
+ fieldOnBlur
52486
+ )
52487
+ }
52488
+ );
52489
+ }
52490
+ return renderInput(
52491
+ ref2,
52492
+ value !== void 0 ? value : "",
52493
+ (numVal, rawStr) => {
52494
+ onChange?.(numVal, rawStr);
52495
+ }
52496
+ );
52497
+ }
52498
+ );
52499
+ AmountInput.displayName = "AmountInput";
52500
+
52501
+ // src/Antd/inputs/SelectInput.tsx
52502
+ import { useState as useState125, useRef as useRef14, useEffect as useEffect122, useMemo as useMemo59, forwardRef as forwardRef15 } from "react";
52503
+ import { ChevronDown as ChevronDown8, Check as Check7, Search as Search4, X as X10 } from "lucide-react";
52504
+ import { Controller as Controller11 } from "react-hook-form";
52505
+ import { jsx as jsx287, jsxs as jsxs255 } from "react/jsx-runtime";
52506
+ var SelectInput = forwardRef15(
52507
+ ({
52508
+ label,
52509
+ id,
52510
+ name,
52511
+ methods,
52512
+ form,
52513
+ required,
52514
+ disabled,
52515
+ error,
52516
+ hint,
52517
+ topRight,
52518
+ icon,
52519
+ placeholder = "Select an option...",
52520
+ className = "",
52521
+ inputClassName = "",
52522
+ containerClassName = "",
52523
+ size = "md",
52524
+ options: options11 = [],
52525
+ value,
52526
+ onChange,
52527
+ isSearchable = false,
52528
+ isClearable = false,
52529
+ emptyText = "No options found"
52530
+ }, ref2) => {
52531
+ const activeForm = useFormInstance(methods, form);
52532
+ const inputId = id || name || (label ? String(label).toLowerCase().replace(/\s+/g, "-") : void 0);
52533
+ const errorMessage = getFormFieldError(name, activeForm, error);
52534
+ const hasError = Boolean(errorMessage);
52535
+ const renderSelect = (buttonRef, currentValue, onValueChange) => {
52536
+ const [isOpen, setIsOpen] = useState125(false);
52537
+ const [searchQuery, setSearchQuery] = useState125("");
52538
+ const dropdownRef = useRef14(null);
52539
+ const searchInputRef = useRef14(null);
52540
+ const selectedOption = useMemo59(() => {
52541
+ return options11.find((opt) => opt.value === currentValue);
52542
+ }, [currentValue, options11]);
52543
+ useEffect122(() => {
52544
+ const handleClickOutside = (event) => {
52545
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
52546
+ setIsOpen(false);
52547
+ }
52548
+ };
52549
+ if (isOpen) {
52550
+ document.addEventListener("mousedown", handleClickOutside);
52551
+ if (isSearchable) {
52552
+ setTimeout(() => searchInputRef.current?.focus(), 50);
52553
+ }
52554
+ }
52555
+ return () => {
52556
+ document.removeEventListener("mousedown", handleClickOutside);
52557
+ };
52558
+ }, [isOpen, isSearchable]);
52559
+ const filteredOptions = useMemo59(() => {
52560
+ if (!isSearchable || !searchQuery.trim()) return options11;
52561
+ const q = searchQuery.toLowerCase().trim();
52562
+ return options11.filter(
52563
+ (opt) => opt.label.toLowerCase().includes(q) || opt.sublabel && opt.sublabel.toLowerCase().includes(q)
52564
+ );
52565
+ }, [isSearchable, searchQuery, options11]);
52566
+ const sizeHeightClass = size === "sm" ? "h-8 text-xs" : size === "lg" ? "h-12 text-sm" : "h-10 text-xs";
52567
+ const handleSelect = (option) => {
52568
+ if (option.disabled || disabled) return;
52569
+ onValueChange(option.value, option);
52570
+ setIsOpen(false);
52571
+ setSearchQuery("");
52572
+ };
52573
+ const handleClear = (e) => {
52574
+ e.stopPropagation();
52575
+ onValueChange("", void 0);
52576
+ };
52577
+ return /* @__PURE__ */ jsx287(
52578
+ FormField_default,
52579
+ {
52580
+ label,
52581
+ id: inputId,
52582
+ required,
52583
+ error: errorMessage,
52584
+ hint,
52585
+ topRight,
52586
+ className,
52587
+ children: /* @__PURE__ */ jsxs255("div", { className: `relative ${containerClassName}`, ref: dropdownRef, children: [
52588
+ /* @__PURE__ */ jsxs255(
52589
+ "button",
52590
+ {
52591
+ ref: buttonRef || ref2,
52592
+ id: inputId,
52593
+ type: "button",
52594
+ disabled,
52595
+ onClick: () => {
52596
+ if (!disabled) {
52597
+ setIsOpen(!isOpen);
52598
+ setSearchQuery("");
52599
+ }
52600
+ },
52601
+ className: `w-full rounded-xl border flex items-center justify-between text-left transition-all cursor-pointer select-none ${sizeHeightClass} ${icon ? "pl-9" : "pl-3"} pr-3 ${hasError ? "border-rose-400 dark:border-rose-800 bg-rose-50/20 dark:bg-rose-950/20 text-rose-900 dark:text-rose-200 focus:outline-none focus:ring-2 focus:ring-rose-500/20 focus:border-rose-500" : isOpen ? "border-emerald-500 ring-2 ring-emerald-500/20 bg-white dark:bg-zinc-850 text-zinc-900 dark:text-zinc-100" : "border-zinc-200 dark:border-zinc-700 bg-zinc-50/50 dark:bg-zinc-800/60 hover:bg-zinc-100/60 dark:hover:bg-zinc-800/90 text-zinc-900 dark:text-zinc-100"} ${disabled ? "opacity-60 cursor-not-allowed bg-zinc-100 dark:bg-zinc-800/40" : ""} ${inputClassName}`,
52602
+ children: [
52603
+ icon && /* @__PURE__ */ jsx287("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-zinc-400", children: icon }),
52604
+ /* @__PURE__ */ jsxs255("div", { className: "flex items-center gap-2 min-w-0 flex-1 truncate", children: [
52605
+ selectedOption?.icon && /* @__PURE__ */ jsx287("span", { className: "shrink-0 text-zinc-500", children: selectedOption.icon }),
52606
+ /* @__PURE__ */ jsx287(
52607
+ "span",
52608
+ {
52609
+ className: `truncate ${selectedOption ? "font-medium text-zinc-900 dark:text-zinc-100" : "text-zinc-400 dark:text-zinc-500 font-normal"}`,
52610
+ children: selectedOption ? selectedOption.label : placeholder
52611
+ }
52612
+ )
52613
+ ] }),
52614
+ /* @__PURE__ */ jsxs255("div", { className: "flex items-center gap-1 shrink-0 ml-2", children: [
52615
+ isClearable && selectedOption && !disabled && /* @__PURE__ */ jsx287(
52616
+ "span",
52617
+ {
52618
+ role: "button",
52619
+ tabIndex: 0,
52620
+ onClick: handleClear,
52621
+ onKeyDown: (e) => {
52622
+ if (e.key === "Enter" || e.key === " ") {
52623
+ handleClear(e);
52624
+ }
52625
+ },
52626
+ className: "p-1 rounded-md text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-700/50 cursor-pointer",
52627
+ title: "Clear selection",
52628
+ children: /* @__PURE__ */ jsx287(X10, { size: 12 })
52629
+ }
52630
+ ),
52631
+ /* @__PURE__ */ jsx287(
52632
+ ChevronDown8,
52633
+ {
52634
+ size: 14,
52635
+ className: `text-zinc-400 transition-transform duration-200 ${isOpen ? "rotate-180 text-emerald-500" : ""}`
52636
+ }
52637
+ )
52638
+ ] })
52639
+ ]
52640
+ }
52641
+ ),
52642
+ isOpen && /* @__PURE__ */ jsxs255("div", { className: "absolute top-full left-0 mt-1.5 z-50 w-full min-w-48 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-2xl shadow-xl overflow-hidden flex flex-col animate-in fade-in zoom-in-95 duration-150", children: [
52643
+ isSearchable && /* @__PURE__ */ jsx287("div", { className: "p-2 border-b border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-900/90 shrink-0", children: /* @__PURE__ */ jsxs255("div", { className: "relative", children: [
52644
+ /* @__PURE__ */ jsx287("div", { className: "absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none text-zinc-400", children: /* @__PURE__ */ jsx287(Search4, { size: 13 }) }),
52645
+ /* @__PURE__ */ jsx287(
52646
+ "input",
52647
+ {
52648
+ ref: searchInputRef,
52649
+ type: "text",
52650
+ value: searchQuery,
52651
+ onChange: (e) => setSearchQuery(e.target.value),
52652
+ placeholder: "Search options...",
52653
+ className: "w-full h-8 pl-8 pr-7 text-xs rounded-lg border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-1 focus:ring-emerald-500 placeholder:text-zinc-400"
52654
+ }
52655
+ ),
52656
+ searchQuery && /* @__PURE__ */ jsx287(
52657
+ "button",
52658
+ {
52659
+ type: "button",
52660
+ onClick: () => setSearchQuery(""),
52661
+ className: "absolute inset-y-0 right-0 pr-2 flex items-center text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 cursor-pointer",
52662
+ children: /* @__PURE__ */ jsx287(X10, { size: 12 })
52663
+ }
52664
+ )
52665
+ ] }) }),
52666
+ /* @__PURE__ */ jsx287("div", { className: "max-h-60 overflow-y-auto p-1 divide-y divide-zinc-50 dark:divide-zinc-850", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx287("div", { className: "p-4 text-center text-xs text-zinc-400", children: emptyText }) : filteredOptions.map((opt, idx) => {
52667
+ const isSelected = opt.value === currentValue;
52668
+ return /* @__PURE__ */ jsxs255(
52669
+ "button",
52670
+ {
52671
+ type: "button",
52672
+ disabled: opt.disabled,
52673
+ onClick: () => handleSelect(opt),
52674
+ className: `w-full px-3 py-2 flex items-center justify-between text-xs rounded-lg transition-colors cursor-pointer text-left ${isSelected ? "bg-emerald-50 dark:bg-emerald-950/40 text-emerald-700 dark:text-emerald-300 font-semibold" : "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-800 dark:text-zinc-200"} ${opt.disabled ? "opacity-50 cursor-not-allowed hover:bg-transparent" : ""}`,
52675
+ children: [
52676
+ /* @__PURE__ */ jsxs255("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
52677
+ opt.icon && /* @__PURE__ */ jsx287("span", { className: "shrink-0", children: opt.icon }),
52678
+ /* @__PURE__ */ jsxs255("div", { className: "min-w-0 flex-1", children: [
52679
+ /* @__PURE__ */ jsx287("div", { className: "truncate", children: opt.label }),
52680
+ opt.sublabel && /* @__PURE__ */ jsx287("div", { className: "text-[10px] text-zinc-400 font-normal truncate", children: opt.sublabel })
52681
+ ] })
52682
+ ] }),
52683
+ /* @__PURE__ */ jsxs255("div", { className: "flex items-center gap-1.5 shrink-0 ml-2", children: [
52684
+ opt.badge && /* @__PURE__ */ jsx287("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full bg-zinc-100 dark:bg-zinc-800 text-zinc-500 font-normal", children: opt.badge }),
52685
+ isSelected && /* @__PURE__ */ jsx287(
52686
+ Check7,
52687
+ {
52688
+ size: 13,
52689
+ className: "text-emerald-500 shrink-0"
52690
+ }
52691
+ )
52692
+ ] })
52693
+ ]
52694
+ },
52695
+ `${opt.value}-${idx}`
52696
+ );
52697
+ }) })
52698
+ ] })
52699
+ ] })
52700
+ }
52701
+ );
52702
+ };
52703
+ if (activeForm && name) {
52704
+ return /* @__PURE__ */ jsx287(
52705
+ Controller11,
52706
+ {
52707
+ control: activeForm.control,
52708
+ name,
52709
+ render: ({
52710
+ field: {
52711
+ onChange: fieldOnChange,
52712
+ value: fieldValue,
52713
+ ref: fieldRef
52714
+ }
52715
+ }) => renderSelect(
52716
+ fieldRef,
52717
+ fieldValue !== void 0 ? fieldValue : value !== void 0 ? value : "",
52718
+ (val, opt) => {
52719
+ fieldOnChange(val);
52720
+ onChange?.(val, opt);
52721
+ }
52722
+ )
52723
+ }
52724
+ );
52725
+ }
52726
+ return renderSelect(
52727
+ ref2,
52728
+ value !== void 0 ? value : "",
52729
+ (val, opt) => {
52730
+ onChange?.(val, opt);
52731
+ }
52732
+ );
52733
+ }
52734
+ );
52735
+ SelectInput.displayName = "SelectInput";
52736
+
52737
+ // src/Antd/inputs/countryData.ts
52738
+ var COUNTRIES = [
52739
+ // Primary / Regional (East Africa & Horn of Africa)
52740
+ {
52741
+ code: "+254",
52742
+ dialCode: "254",
52743
+ country: "Kenya",
52744
+ flag: "\u{1F1F0}\u{1F1EA}",
52745
+ sample: "712 345 678",
52746
+ expectedLength: 9,
52747
+ minLength: 9,
52748
+ maxLength: 9,
52749
+ pattern: /^[17]\d{8}$/
52750
+ },
52751
+ {
52752
+ code: "+252",
52753
+ dialCode: "252",
52754
+ country: "Somalia",
52755
+ flag: "\u{1F1F8}\u{1F1F4}",
52756
+ sample: "61 234 5678",
52757
+ expectedLength: 9,
52758
+ minLength: 8,
52759
+ maxLength: 9,
52760
+ pattern: /^[679]\d{7,8}$/
52761
+ },
52762
+ {
52763
+ code: "+256",
52764
+ dialCode: "256",
52765
+ country: "Uganda",
52766
+ flag: "\u{1F1FA}\u{1F1EC}",
52767
+ sample: "712 345 678",
52768
+ expectedLength: 9,
52769
+ minLength: 9,
52770
+ maxLength: 9,
52771
+ pattern: /^[7]\d{8}$/
52772
+ },
52773
+ {
52774
+ code: "+255",
52775
+ dialCode: "255",
52776
+ country: "Tanzania",
52777
+ flag: "\u{1F1F9}\u{1F1FF}",
52778
+ sample: "712 345 678",
52779
+ expectedLength: 9,
52780
+ minLength: 9,
52781
+ maxLength: 9,
52782
+ pattern: /^[67]\d{8}$/
52783
+ },
52784
+ {
52785
+ code: "+251",
52786
+ dialCode: "251",
52787
+ country: "Ethiopia",
52788
+ flag: "\u{1F1EA}\u{1F1F9}",
52789
+ sample: "91 234 5678",
52790
+ expectedLength: 9,
52791
+ minLength: 9,
52792
+ maxLength: 9,
52793
+ pattern: /^[79]\d{8}$/
52794
+ },
52795
+ {
52796
+ code: "+253",
52797
+ dialCode: "253",
52798
+ country: "Djibouti",
52799
+ flag: "\u{1F1E9}\u{1F1EF}",
52800
+ sample: "77 12 34 56",
52801
+ expectedLength: 8,
52802
+ minLength: 8,
52803
+ maxLength: 8,
52804
+ pattern: /^[72]\d{7}$/
52805
+ },
52806
+ {
52807
+ code: "+211",
52808
+ dialCode: "211",
52809
+ country: "South Sudan",
52810
+ flag: "\u{1F1F8}\u{1F1F8}",
52811
+ sample: "912 345 678",
52812
+ expectedLength: 9,
52813
+ minLength: 9,
52814
+ maxLength: 9,
52815
+ pattern: /^[9]\d{8}$/
52816
+ },
52817
+ {
52818
+ code: "+250",
52819
+ dialCode: "250",
52820
+ country: "Rwanda",
52821
+ flag: "\u{1F1F7}\u{1F1FC}",
52822
+ sample: "788 123 456",
52823
+ expectedLength: 9,
52824
+ minLength: 9,
52825
+ maxLength: 9,
52826
+ pattern: /^[7]\d{8}$/
52827
+ },
52828
+ {
52829
+ code: "+257",
52830
+ dialCode: "257",
52831
+ country: "Burundi",
52832
+ flag: "\u{1F1E7}\u{1F1EE}",
52833
+ sample: "79 123 456",
52834
+ expectedLength: 8,
52835
+ minLength: 8,
52836
+ maxLength: 8,
52837
+ pattern: /^[76]\d{7}$/
52838
+ },
52839
+ {
52840
+ code: "+249",
52841
+ dialCode: "249",
52842
+ country: "Sudan",
52843
+ flag: "\u{1F1F8}\u{1F1E9}",
52844
+ sample: "91 234 5678",
52845
+ expectedLength: 9,
52846
+ minLength: 9,
52847
+ maxLength: 9,
52848
+ pattern: /^[91]\d{8}$/
52849
+ },
52850
+ // Middle East & Gulf
52851
+ {
52852
+ code: "+971",
52853
+ dialCode: "971",
52854
+ country: "United Arab Emirates",
52855
+ flag: "\u{1F1E6}\u{1F1EA}",
52856
+ sample: "50 123 4567",
52857
+ expectedLength: 9,
52858
+ minLength: 9,
52859
+ maxLength: 9,
52860
+ pattern: /^[5]\d{8}$/
52861
+ },
52862
+ {
52863
+ code: "+966",
52864
+ dialCode: "966",
52865
+ country: "Saudi Arabia",
52866
+ flag: "\u{1F1F8}\u{1F1E6}",
52867
+ sample: "50 123 4567",
52868
+ expectedLength: 9,
52869
+ minLength: 9,
52870
+ maxLength: 9,
52871
+ pattern: /^[5]\d{8}$/
52872
+ },
52873
+ {
52874
+ code: "+974",
52875
+ dialCode: "974",
52876
+ country: "Qatar",
52877
+ flag: "\u{1F1F6}\u{1F1E6}",
52878
+ sample: "3312 3456",
52879
+ expectedLength: 8,
52880
+ minLength: 8,
52881
+ maxLength: 8,
52882
+ pattern: /^[3567]\d{7}$/
52883
+ },
52884
+ {
52885
+ code: "+968",
52886
+ dialCode: "968",
52887
+ country: "Oman",
52888
+ flag: "\u{1F1F4}\u{1F1F2}",
52889
+ sample: "9123 4567",
52890
+ expectedLength: 8,
52891
+ minLength: 8,
52892
+ maxLength: 8,
52893
+ pattern: /^[79]\d{7}$/
52894
+ },
52895
+ {
52896
+ code: "+965",
52897
+ dialCode: "965",
52898
+ country: "Kuwait",
52899
+ flag: "\u{1F1F0}\u{1F1FC}",
52900
+ sample: "9123 4567",
52901
+ expectedLength: 8,
52902
+ minLength: 8,
52903
+ maxLength: 8,
52904
+ pattern: /^[569]\d{7}$/
52905
+ },
52906
+ {
52907
+ code: "+973",
52908
+ dialCode: "973",
52909
+ country: "Bahrain",
52910
+ flag: "\u{1F1E7}\u{1F1ED}",
52911
+ sample: "3912 3456",
52912
+ expectedLength: 8,
52913
+ minLength: 8,
52914
+ maxLength: 8,
52915
+ pattern: /^[36]\d{7}$/
52916
+ },
52917
+ {
52918
+ code: "+967",
52919
+ dialCode: "967",
52920
+ country: "Yemen",
52921
+ flag: "\u{1F1FE}\u{1F1EA}",
52922
+ sample: "71 234 567",
52923
+ expectedLength: 8,
52924
+ minLength: 8,
52925
+ maxLength: 9,
52926
+ pattern: /^[7]\d{7,8}$/
52927
+ },
52928
+ {
52929
+ code: "+20",
52930
+ dialCode: "20",
52931
+ country: "Egypt",
52932
+ flag: "\u{1F1EA}\u{1F1EC}",
52933
+ sample: "10 1234 5678",
52934
+ expectedLength: 10,
52935
+ minLength: 10,
52936
+ maxLength: 10,
52937
+ pattern: /^[1]\d{9}$/
52938
+ },
52939
+ {
52940
+ code: "+90",
52941
+ dialCode: "90",
52942
+ country: "Turkey",
52943
+ flag: "\u{1F1F9}\u{1F1F7}",
52944
+ sample: "512 345 6789",
52945
+ expectedLength: 10,
52946
+ minLength: 10,
52947
+ maxLength: 10,
52948
+ pattern: /^[5]\d{9}$/
52949
+ },
52950
+ // Europe & Americas
52951
+ {
52952
+ code: "+44",
52953
+ dialCode: "44",
52954
+ country: "United Kingdom",
52955
+ flag: "\u{1F1EC}\u{1F1E7}",
52956
+ sample: "7123 456789",
52957
+ expectedLength: 10,
52958
+ minLength: 10,
52959
+ maxLength: 10,
52960
+ pattern: /^[7]\d{9}$/
52961
+ },
52962
+ {
52963
+ code: "+1",
52964
+ dialCode: "1",
52965
+ country: "United States",
52966
+ flag: "\u{1F1FA}\u{1F1F8}",
52967
+ sample: "202 555 0123",
52968
+ expectedLength: 10,
52969
+ minLength: 10,
52970
+ maxLength: 10,
52971
+ pattern: /^[2-9]\d{9}$/
52972
+ },
52973
+ {
52974
+ code: "+1",
52975
+ dialCode: "1",
52976
+ country: "Canada",
52977
+ flag: "\u{1F1E8}\u{1F1E6}",
52978
+ sample: "416 555 0123",
52979
+ expectedLength: 10,
52980
+ minLength: 10,
52981
+ maxLength: 10,
52982
+ pattern: /^[2-9]\d{9}$/
52983
+ },
52984
+ {
52985
+ code: "+49",
52986
+ dialCode: "49",
52987
+ country: "Germany",
52988
+ flag: "\u{1F1E9}\u{1F1EA}",
52989
+ sample: "151 23456789",
52990
+ expectedLength: 10,
52991
+ minLength: 10,
52992
+ maxLength: 11,
52993
+ pattern: /^[1]\d{9,10}$/
52994
+ },
52995
+ {
52996
+ code: "+33",
52997
+ dialCode: "33",
52998
+ country: "France",
52999
+ flag: "\u{1F1EB}\u{1F1F7}",
53000
+ sample: "6 12 34 56 78",
53001
+ expectedLength: 9,
53002
+ minLength: 9,
53003
+ maxLength: 9,
53004
+ pattern: /^[67]\d{8}$/
53005
+ },
53006
+ {
53007
+ code: "+39",
53008
+ dialCode: "39",
53009
+ country: "Italy",
53010
+ flag: "\u{1F1EE}\u{1F1F9}",
53011
+ sample: "312 345 6789",
53012
+ expectedLength: 10,
53013
+ minLength: 9,
53014
+ maxLength: 10,
53015
+ pattern: /^[3]\d{8,9}$/
53016
+ },
53017
+ {
53018
+ code: "+34",
53019
+ dialCode: "34",
53020
+ country: "Spain",
53021
+ flag: "\u{1F1EA}\u{1F1F8}",
53022
+ sample: "612 34 56 78",
53023
+ expectedLength: 9,
53024
+ minLength: 9,
53025
+ maxLength: 9,
53026
+ pattern: /^[67]\d{8}$/
53027
+ },
53028
+ {
53029
+ code: "+31",
53030
+ dialCode: "31",
53031
+ country: "Netherlands",
53032
+ flag: "\u{1F1F3}\u{1F1F1}",
53033
+ sample: "6 12345678",
53034
+ expectedLength: 9,
53035
+ minLength: 9,
53036
+ maxLength: 9,
53037
+ pattern: /^[6]\d{8}$/
53038
+ },
53039
+ {
53040
+ code: "+46",
53041
+ dialCode: "46",
53042
+ country: "Sweden",
53043
+ flag: "\u{1F1F8}\u{1F1EA}",
53044
+ sample: "70 123 45 67",
53045
+ expectedLength: 9,
53046
+ minLength: 9,
53047
+ maxLength: 9,
53048
+ pattern: /^[7]\d{8}$/
53049
+ },
53050
+ {
53051
+ code: "+47",
53052
+ dialCode: "47",
53053
+ country: "Norway",
53054
+ flag: "\u{1F1F3}\u{1F1F4}",
53055
+ sample: "412 34 567",
53056
+ expectedLength: 8,
53057
+ minLength: 8,
53058
+ maxLength: 8,
53059
+ pattern: /^[49]\d{7}$/
53060
+ },
53061
+ {
53062
+ code: "+41",
53063
+ dialCode: "41",
53064
+ country: "Switzerland",
53065
+ flag: "\u{1F1E8}\u{1F1ED}",
53066
+ sample: "78 123 45 67",
53067
+ expectedLength: 9,
53068
+ minLength: 9,
53069
+ maxLength: 9,
53070
+ pattern: /^[7]\d{8}$/
53071
+ },
53072
+ // Asia & Africa
53073
+ {
53074
+ code: "+86",
53075
+ dialCode: "86",
53076
+ country: "China",
53077
+ flag: "\u{1F1E8}\u{1F1F3}",
53078
+ sample: "131 2345 6789",
53079
+ expectedLength: 11,
53080
+ minLength: 11,
53081
+ maxLength: 11,
53082
+ pattern: /^[1]\d{10}$/
53083
+ },
53084
+ {
53085
+ code: "+91",
53086
+ dialCode: "91",
53087
+ country: "India",
53088
+ flag: "\u{1F1EE}\u{1F1F3}",
53089
+ sample: "98765 43210",
53090
+ expectedLength: 10,
53091
+ minLength: 10,
53092
+ maxLength: 10,
53093
+ pattern: /^[6-9]\d{9}$/
53094
+ },
53095
+ {
53096
+ code: "+92",
53097
+ dialCode: "92",
53098
+ country: "Pakistan",
53099
+ flag: "\u{1F1F5}\u{1F1F0}",
53100
+ sample: "301 2345678",
53101
+ expectedLength: 10,
53102
+ minLength: 10,
53103
+ maxLength: 10,
53104
+ pattern: /^[3]\d{9}$/
53105
+ },
53106
+ {
53107
+ code: "+27",
53108
+ dialCode: "27",
53109
+ country: "South Africa",
53110
+ flag: "\u{1F1FF}\u{1F1E6}",
53111
+ sample: "71 234 5678",
53112
+ expectedLength: 9,
53113
+ minLength: 9,
53114
+ maxLength: 9,
53115
+ pattern: /^[6-8]\d{8}$/
53116
+ },
53117
+ {
53118
+ code: "+234",
53119
+ dialCode: "234",
53120
+ country: "Nigeria",
53121
+ flag: "\u{1F1F3}\u{1F1EC}",
53122
+ sample: "802 123 4567",
53123
+ expectedLength: 10,
53124
+ minLength: 10,
53125
+ maxLength: 10,
53126
+ pattern: /^[789]\d{9}$/
53127
+ },
53128
+ {
53129
+ code: "+233",
53130
+ dialCode: "233",
53131
+ country: "Ghana",
53132
+ flag: "\u{1F1EC}\u{1F1ED}",
53133
+ sample: "23 123 4567",
53134
+ expectedLength: 9,
53135
+ minLength: 9,
53136
+ maxLength: 9,
53137
+ pattern: /^[25]\d{8}$/
53138
+ },
53139
+ {
53140
+ code: "+61",
53141
+ dialCode: "61",
53142
+ country: "Australia",
53143
+ flag: "\u{1F1E6}\u{1F1FA}",
53144
+ sample: "412 345 678",
53145
+ expectedLength: 9,
53146
+ minLength: 9,
53147
+ maxLength: 9,
53148
+ pattern: /^[4]\d{8}$/
53149
+ },
53150
+ {
53151
+ code: "+60",
53152
+ dialCode: "60",
53153
+ country: "Malaysia",
53154
+ flag: "\u{1F1F2}\u{1F1FE}",
53155
+ sample: "12 345 6789",
53156
+ expectedLength: 9,
53157
+ minLength: 9,
53158
+ maxLength: 10,
53159
+ pattern: /^[1]\d{8,9}$/
53160
+ },
53161
+ {
53162
+ code: "+65",
53163
+ dialCode: "65",
53164
+ country: "Singapore",
53165
+ flag: "\u{1F1F8}\u{1F1EC}",
53166
+ sample: "8123 4567",
53167
+ expectedLength: 8,
53168
+ minLength: 8,
53169
+ maxLength: 8,
53170
+ pattern: /^[89]\d{7}$/
53171
+ }
53172
+ ];
53173
+ var DEFAULT_COUNTRY = COUNTRIES[0];
53174
+
53175
+ // src/Antd/inputs/index.ts
53176
+ var AntdFormInput = {
53177
+ Field: FormField,
53178
+ Text: TextInput,
53179
+ Email: EmailInput,
53180
+ Phone: PhoneInput2,
53181
+ Number: NumberInput,
53182
+ Amount: AmountInput,
53183
+ Select: SelectInput
51806
53184
  };
53185
+ var inputs_default = AntdFormInput;
51807
53186
  export {
51808
53187
  balances_default as AccountBalances,
51809
53188
  Feilds_default as AccountFields,
@@ -51812,6 +53191,7 @@ export {
51812
53191
  Statements_default as AccountStatements,
51813
53192
  Accounts_default as Accounts,
51814
53193
  AdminProtectedRoute,
53194
+ inputs_default as AntdInputAntdFormInput,
51815
53195
  Badge,
51816
53196
  Feilds_default3 as BrandField,
51817
53197
  BrandForm_default as BrandForm,