@rubenpazch/text-input 4.0.0 → 5.0.0
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/TextInput.d.ts +15 -0
- package/dist/TextInput.d.ts.map +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +8 -7
package/dist/TextInput.d.ts
CHANGED
|
@@ -23,7 +23,22 @@ export interface TextInputProps {
|
|
|
23
23
|
step?: number;
|
|
24
24
|
validateEmail?: boolean;
|
|
25
25
|
showPasswordStrength?: boolean;
|
|
26
|
+
requiredMessage?: string;
|
|
27
|
+
emailValidMessage?: string;
|
|
28
|
+
emailInvalidMessage?: string;
|
|
29
|
+
emailSuggestionMessage?: string;
|
|
30
|
+
strengthLabels?: Partial<Record<PasswordStrengthKey, string>>;
|
|
31
|
+
strengthLabelPrefix?: string;
|
|
32
|
+
requirementsLabels?: Partial<PasswordRequirementsLabels>;
|
|
26
33
|
}
|
|
34
|
+
type PasswordStrengthKey = "none" | "weak" | "fair" | "good" | "strong" | "very-strong";
|
|
35
|
+
type PasswordRequirementsLabels = {
|
|
36
|
+
lowercase: string;
|
|
37
|
+
uppercase: string;
|
|
38
|
+
number: string;
|
|
39
|
+
special: string;
|
|
40
|
+
minLength: string;
|
|
41
|
+
};
|
|
27
42
|
declare const TextInput: React.FC<TextInputProps>;
|
|
28
43
|
export default TextInput;
|
|
29
44
|
//# sourceMappingURL=TextInput.d.ts.map
|
package/dist/TextInput.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../src/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../src/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAC;CAC1D;AAmCD,KAAK,mBAAmB,GACpB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,CAAC;AAElB,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0BF,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAmYvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e
|
|
1
|
+
"use strict";var e=require("react");function n(e){var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,Object.freeze(n)}var t,r=n(e),o={exports:{}},a={};var l,s,i={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.development.js
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/function s(){return o||(o=1,"production"!==process.env.NODE_ENV&&function(){function e(n){if(null==n)return null;if("function"==typeof n)return n.$$typeof===k?null:n.displayName||n.name||null;if("string"==typeof n)return n;switch(n){case x:return"Fragment";case h:return"Profiler";case g:return"StrictMode";case I:return"Suspense";case v:return"SuspenseList";case N:return"Activity"}if("object"==typeof n)switch("number"==typeof n.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case p:return"Portal";case T:return n.displayName||"Context";case f:return(n._context.displayName||"Context")+".Consumer";case b:var t=n.render;return(n=n.displayName)||(n=""!==(n=t.displayName||t.name||"")?"ForwardRef("+n+")":"ForwardRef"),n;case y:return null!==(t=n.displayName||null)?t:e(n.type)||"Memo";case j:t=n._payload,n=n._init;try{return e(n(t))}catch(e){}}return null}function t(e){return""+e}function r(e){try{t(e);var n=!1}catch(e){n=!0}if(n){var r=(n=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),t(e)}}function o(n){if(n===x)return"<>";if("object"==typeof n&&null!==n&&n.$$typeof===j)return"<...>";try{var t=e(n);return t?"<"+t+">":"<...>"}catch(e){return"<...>"}}function l(){return Error("react-stack-top-frame")}function s(){var n=e(this.type);return z[n]||(z[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(n=this.props.ref)?n:null}function u(n,t,o,l,a,u){var d,m=t.children;if(void 0!==m)if(l)if(C(m)){for(l=0;l<m.length;l++)i(m[l]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else i(m);if(w.call(t,"key")){m=e(n);var p=Object.keys(t).filter(function(e){return"key"!==e});l=0<p.length?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}",L[m+l]||(p=0<p.length?"{"+p.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',l,m,p,m),L[m+l]=!0)}if(m=null,void 0!==o&&(r(o),m=""+o),function(e){if(w.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return void 0!==e.key}(t)&&(r(t.key),m=""+t.key),"key"in t)for(var x in o={},t)"key"!==x&&(o[x]=t[x]);else o=t;return m&&function(e,n){function t(){c||(c=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof n?n.displayName||n.name||"Unknown":n),function(e,n,t,r,o,l){var a=t.ref;return e={$$typeof:_,type:e,key:n,props:t,_owner:r},null!==(void 0!==a?a:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:s}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:l}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(n,m,o,null===(d=S.A)?null:d.getOwner(),a,u)}function i(e){d(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===j&&("fulfilled"===e._payload.status?d(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function d(e){return"object"==typeof e&&null!==e&&e.$$typeof===_}var c,m=n,_=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),T=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),S=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w=Object.prototype.hasOwnProperty,C=Array.isArray,R=console.createTask?console.createTask:function(){return null},z={},q=(m={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(m,l)(),A=R(o(l)),L={};a.Fragment=x,a.jsx=function(e,n,t){var r=1e4>S.recentlyCreatedOwnerStacks++;return u(e,n,t,!1,r?Error("react-stack-top-frame"):q,r?R(o(e)):A)},a.jsxs=function(e,n,t){var r=1e4>S.recentlyCreatedOwnerStacks++;return u(e,n,t,!0,r?Error("react-stack-top-frame"):q,r?R(o(e)):A)}}()),a}var u=(l||(l=1,"production"===process.env.NODE_ENV?t.exports=function(){if(e)return r;e=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var l in r={},t)"key"!==l&&(r[l]=t[l]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}return r.Fragment=t,r.jsx=o,r.jsxs=o,r}():t.exports=s()),t.exports);var i="TextInput-module_container__QXVA9",d="TextInput-module_label__GGFxk",c="TextInput-module_required__qlHAH",m="TextInput-module_inputContainer__-zaWR",_="TextInput-module_icon__F1AYg",p="TextInput-module_input__I8TSn",x="TextInput-module_inputWithIcon__TDgMC",g="TextInput-module_inputWithCharCount__qgvqA",h="TextInput-module_inputError__-Ga78",f="TextInput-module_charCount__RyuVm",T="TextInput-module_charCountNormal__LCUr7",b="TextInput-module_charCountNear__OKroK",I="TextInput-module_charCountLimit__iaB20",v="TextInput-module_charCountIcon__lRD-4",y="TextInput-module_charProgressBar__Wva8D",j="TextInput-module_charProgress__ZUsGs",N="TextInput-module_charProgressNormal__TdFY4",k="TextInput-module_charProgressNear__beyMs",S="TextInput-module_charProgressLimit__Vr6d-",w="TextInput-module_hint__iZiig",C="TextInput-module_validationMessage__3g-wc",R="TextInput-module_validationIcon__q5LT6",z="TextInput-module_validationText__-qAuu",q="TextInput-module_validEmail__Ya1tf",A="TextInput-module_emailSuggestion__ZzQkZ",L="TextInput-module_suggestionButton__Rsxt8",O="TextInput-module_error__ewnmB",M="TextInput-module_errorIcon__JkIpb",P="TextInput-module_errorText__ba7lR",V="TextInput-module_passwordStrength__ICyJU",B="TextInput-module_strengthBar__3c8Yf",E="TextInput-module_strengthSegment__76ih4",F="TextInput-module_strengthSegmentInactive__RK1Q8",Z="TextInput-module_strengthSegmentWeak__BFvgT",$="TextInput-module_strengthSegmentFair__AOJW5",G="TextInput-module_strengthSegmentGood__uGgTx",D="TextInput-module_strengthSegmentStrong__vP5Yi",U="TextInput-module_strengthSegmentVeryStrong__4Tull",W="TextInput-module_strengthLabel__PpEO9",Y="TextInput-module_strengthText__jfVUh",K="TextInput-module_strengthValue__04hhw",Q="TextInput-module_strengthValueWeak__8Ek8Q",J="TextInput-module_strengthValueFair__70N63",H="TextInput-module_strengthValueGood__NgsOd",X="TextInput-module_strengthValueStrong__qaKsi",ee="TextInput-module_strengthValueVeryStrong__80d9m",ne="TextInput-module_requirements__eD6oz",te="TextInput-module_requirement__KoZx2",re="TextInput-module_requirementIcon__VjQXJ",oe="TextInput-module_requirementIconMet__UNZFD",le="TextInput-module_requirementIconUnmet__1MF9h",ae="TextInput-module_requirementText__fFcdn",se="TextInput-module_requirementTextMet__eGbSi";!function(e,n){void 0===n&&(n={});var t=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("/* Container */\n.TextInput-module_container__QXVA9 {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n/* Label */\n.TextInput-module_label__GGFxk {\n display: block;\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 500;\n color: #374151;\n}\n\n.TextInput-module_required__qlHAH {\n color: #ef4444;\n margin-left: 0.25rem;\n}\n\n/* Input container */\n.TextInput-module_inputContainer__-zaWR {\n position: relative;\n}\n\n/* Icon */\n.TextInput-module_icon__F1AYg {\n position: absolute;\n left: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n color: #9ca3af;\n pointer-events: none;\n display: flex;\n align-items: center;\n}\n\n/* Input */\n.TextInput-module_input__I8TSn {\n width: 100%;\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n border: 2px solid #d1d5db;\n transition: all 150ms ease;\n outline: none;\n font-weight: 500;\n color: #111827;\n}\n\n.TextInput-module_input__I8TSn::-moz-placeholder {\n color: #9ca3af;\n}\n\n.TextInput-module_input__I8TSn::placeholder {\n color: #9ca3af;\n}\n\n.TextInput-module_inputWithIcon__TDgMC {\n padding-left: 2.5rem;\n}\n\n.TextInput-module_inputWithCharCount__qgvqA {\n padding-right: 5rem;\n}\n\n.TextInput-module_input__I8TSn:hover:not(:disabled) {\n border-color: #9ca3af;\n}\n\n.TextInput-module_input__I8TSn:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);\n}\n\n.TextInput-module_input__I8TSn:disabled {\n background: #f3f4f6;\n color: #6b7280;\n cursor: not-allowed;\n}\n\n.TextInput-module_inputError__-Ga78 {\n border-color: #ef4444;\n}\n\n.TextInput-module_inputError__-Ga78:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);\n}\n\n/* Character count */\n.TextInput-module_charCount__RyuVm {\n position: absolute;\n right: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n font-size: 0.75rem;\n line-height: 1rem;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n}\n\n.TextInput-module_charCountNormal__LCUr7 {\n color: #6b7280;\n}\n\n.TextInput-module_charCountNear__OKroK {\n color: #d97706;\n}\n\n.TextInput-module_charCountLimit__iaB20 {\n color: #dc2626;\n}\n\n.TextInput-module_charCountIcon__lRD-4 {\n width: 1rem;\n height: 1rem;\n}\n\n/* Progress bar */\n.TextInput-module_charProgressBar__Wva8D {\n width: 100%;\n height: 0.25rem;\n background: #e5e7eb;\n border-radius: 9999px;\n overflow: hidden;\n}\n\n.TextInput-module_charProgress__ZUsGs {\n height: 100%;\n transition: all 150ms ease;\n border-radius: 9999px;\n}\n\n.TextInput-module_charProgressNormal__TdFY4 {\n background: #3b82f6;\n}\n\n.TextInput-module_charProgressNear__beyMs {\n background: #f59e0b;\n}\n\n.TextInput-module_charProgressLimit__Vr6d- {\n background: #ef4444;\n}\n\n/* Hint text */\n.TextInput-module_hint__iZiig {\n font-size: 0.75rem;\n line-height: 1rem;\n color: #6b7280;\n margin-top: 0.25rem;\n}\n\n/* Validation messages */\n.TextInput-module_validationMessage__3g-wc {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin-top: 0.25rem;\n}\n\n.TextInput-module_validationIcon__q5LT6 {\n width: 1rem;\n height: 1rem;\n flex-shrink: 0;\n}\n\n.TextInput-module_validationText__-qAuu {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.TextInput-module_validEmail__Ya1tf .TextInput-module_validationIcon__q5LT6 {\n color: #10b981;\n}\n\n.TextInput-module_validEmail__Ya1tf .TextInput-module_validationText__-qAuu {\n color: #059669;\n}\n\n.TextInput-module_emailSuggestion__ZzQkZ .TextInput-module_validationIcon__q5LT6 {\n color: #3b82f6;\n}\n\n.TextInput-module_emailSuggestion__ZzQkZ .TextInput-module_validationText__-qAuu {\n color: #2563eb;\n}\n\n.TextInput-module_suggestionButton__Rsxt8 {\n font-weight: 600;\n text-decoration: underline;\n background: none;\n border: none;\n color: inherit;\n cursor: pointer;\n padding: 0;\n}\n\n.TextInput-module_suggestionButton__Rsxt8:hover {\n color: #1e40af;\n}\n\n/* Error message */\n.TextInput-module_error__ewnmB {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n margin-top: 0.25rem;\n}\n\n.TextInput-module_errorIcon__JkIpb {\n width: 1rem;\n height: 1rem;\n color: #ef4444;\n flex-shrink: 0;\n margin-top: 0.125rem;\n}\n\n.TextInput-module_errorText__ba7lR {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: #dc2626;\n}\n\n/* Password strength */\n.TextInput-module_passwordStrength__ICyJU {\n margin-top: 0.5rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.TextInput-module_strengthBar__3c8Yf {\n display: flex;\n gap: 0.25rem;\n}\n\n.TextInput-module_strengthSegment__76ih4 {\n height: 0.375rem;\n flex: 1;\n border-radius: 9999px;\n transition: background-color 150ms ease;\n}\n\n.TextInput-module_strengthSegmentInactive__RK1Q8 {\n background: #e5e7eb;\n}\n\n.TextInput-module_strengthSegmentWeak__BFvgT {\n background: #ef4444;\n}\n\n.TextInput-module_strengthSegmentFair__AOJW5 {\n background: #f59e0b;\n}\n\n.TextInput-module_strengthSegmentGood__uGgTx {\n background: #eab308;\n}\n\n.TextInput-module_strengthSegmentStrong__vP5Yi {\n background: #84cc16;\n}\n\n.TextInput-module_strengthSegmentVeryStrong__4Tull {\n background: #10b981;\n}\n\n.TextInput-module_strengthLabel__PpEO9 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.TextInput-module_strengthText__jfVUh {\n font-size: 0.75rem;\n line-height: 1rem;\n color: #4b5563;\n}\n\n.TextInput-module_strengthValue__04hhw {\n font-weight: 600;\n}\n\n.TextInput-module_strengthValueWeak__8Ek8Q {\n color: #dc2626;\n}\n\n.TextInput-module_strengthValueFair__70N63 {\n color: #d97706;\n}\n\n.TextInput-module_strengthValueGood__NgsOd {\n color: #ca8a04;\n}\n\n.TextInput-module_strengthValueStrong__qaKsi {\n color: #65a30d;\n}\n\n.TextInput-module_strengthValueVeryStrong__80d9m {\n color: #059669;\n}\n\n/* Requirements checklist */\n.TextInput-module_requirements__eD6oz {\n font-size: 0.75rem;\n line-height: 1rem;\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n padding: 0.5rem;\n background: #f9fafb;\n border-radius: 0.375rem;\n border: 1px solid #e5e7eb;\n}\n\n.TextInput-module_requirement__KoZx2 {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.TextInput-module_requirementIcon__VjQXJ {\n width: 0.875rem;\n height: 0.875rem;\n flex-shrink: 0;\n}\n\n.TextInput-module_requirementIconMet__UNZFD {\n color: #10b981;\n}\n\n.TextInput-module_requirementIconUnmet__1MF9h {\n color: #d1d5db;\n}\n\n.TextInput-module_requirementText__fFcdn {\n color: #6b7280;\n}\n\n.TextInput-module_requirementTextMet__eGbSi {\n color: #374151;\n}\n");const ue=(...e)=>e.filter(Boolean).join(" "),ie=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;module.exports=({label:e,value:t,onChange:r,placeholder:o,error:l,required:a=!1,disabled:s=!1,type:de="text",className:ce="",hint:me,maxLength:_e,minLength:pe,pattern:xe,icon:ge,onBlur:he,onFocus:fe,autoComplete:Te,validateEmail:be=!1,showPasswordStrength:Ie=!1})=>{const[ve,ye]=n.useState(!1),je=n.useMemo(()=>be&&t?(e=>{if(!e||!e.includes("@"))return null;const[n,t]=e.split("@");if(!t)return null;const r={"gmial.com":"gmail.com","gmai.com":"gmail.com","gmil.com":"gmail.com","hotmial.com":"hotmail.com","hotmal.com":"hotmail.com","outlok.com":"outlook.com","yahooo.com":"yahoo.com","yaho.com":"yahoo.com"};return r[t.toLowerCase()]?`${n}@${r[t.toLowerCase()]}`:null})(t):null,[be,t]),Ne=n.useMemo(()=>{if(!be||!t)return null;return ie.test(t)&&!(null!==je)},[be,t,je]),ke=be&&t&&!Ne&&!je?"Correo electrónico inválido":null,Se=n.useMemo(()=>"password"===de&&Ie?(e=>{if(!e)return{score:0,strength:"none",label:"Sin contraseña"};let n=0;const t=/[A-Z]/.test(e);return/[a-z]/.test(e)&&n++,t&&n++,/\d/.test(e)&&n++,/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(e)&&n++,e.length>=8&&n++,n<=1?{score:n,strength:"weak",label:"Débil"}:n<=2?{score:n,strength:"fair",label:"Regular"}:n<=3?{score:n,strength:"good",label:"Buena"}:4===n?{score:n,strength:"strong",label:"Fuerte"}:{score:n,strength:"very-strong",label:"Muy fuerte"}})(t):null,[de,t,Ie]),we=_e&&"text"===de&&t,Ce=t.length,Re=_e?Ce/_e*100:0,ze=Re>80,qe=Re>=100;return u.jsxs("div",{className:ue(i,ce),"data-testid":"text-input",children:[e&&u.jsxs("label",{className:d,children:[e,a&&u.jsx("span",{className:c,children:"*"})]}),u.jsxs("div",{className:m,children:[ge&&!ve&&u.jsx("div",{className:_,children:ge}),u.jsx("input",{type:de,value:t,onChange:e=>r(e.target.value),onFocus:()=>{ye(!0),fe?.()},onBlur:()=>{ye(!1),he?.()},placeholder:o,disabled:s,maxLength:_e,minLength:pe,pattern:xe,autoComplete:Te,className:ue(p,ge?x:void 0,we?g:void 0,l?h:void 0),"data-testid":"input-field","data-error":!!l}),we&&u.jsxs("div",{className:ue(f,qe?I:ze?b:T),"data-testid":"char-count",children:[u.jsxs("div",{children:[Ce,"/",_e]}),qe&&u.jsx("svg",{className:v,fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})]})]}),we&&_e>20&&u.jsx("div",{className:y,children:u.jsx("div",{className:ue(j,qe?S:ze?k:N),style:{width:`${Math.min(Re,100)}%`}})}),me&&!l&&!ke&&u.jsx("p",{className:w,children:me}),be&&t&&Ne&&u.jsxs("div",{className:ue(C,q),children:[u.jsx("svg",{className:R,fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),u.jsx("p",{className:z,children:"Correo válido"})]}),je&&!l&&u.jsxs("div",{className:ue(C,A),children:[u.jsx("svg",{className:R,fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),u.jsxs("p",{className:z,children:["¿Quisiste decir"," ",u.jsx("button",{type:"button",onClick:()=>r(je),className:L,children:je}),"?"]})]}),Se&&Se.score>0&&u.jsxs("div",{className:V,children:[u.jsx("div",{className:B,children:[0,1,2,3,4].map(e=>u.jsx("div",{className:ue(E,e<Se.score?"weak"===Se.strength?Z:"fair"===Se.strength?$:"good"===Se.strength?G:"strong"===Se.strength?D:U:F)},e))}),u.jsx("div",{className:W,children:u.jsxs("p",{className:Y,children:["Fortaleza:"," ",u.jsx("span",{className:ue(K,"weak"===Se.strength?Q:"fair"===Se.strength?J:"good"===Se.strength?H:"strong"===Se.strength?X:ee),children:Se.label})]})}),u.jsxs("div",{className:ne,children:[u.jsxs("div",{className:te,children:[u.jsx("svg",{className:ue(re,/[a-z]/.test(t)?oe:le),fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),u.jsx("span",{className:ue(ae,/[a-z]/.test(t)&&se),children:"Letras minúsculas"})]}),u.jsxs("div",{className:te,children:[u.jsx("svg",{className:ue(re,/[A-Z]/.test(t)?oe:le),fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),u.jsx("span",{className:ue(ae,/[A-Z]/.test(t)&&se),children:"Letras mayúsculas"})]}),u.jsxs("div",{className:te,children:[u.jsx("svg",{className:ue(re,/\d/.test(t)?oe:le),fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),u.jsx("span",{className:ue(ae,/\d/.test(t)&&se),children:"Números"})]}),u.jsxs("div",{className:te,children:[u.jsx("svg",{className:ue(re,/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(t)?oe:le),fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),u.jsx("span",{className:ue(ae,/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(t)&&se),children:"Caracteres especiales"})]}),u.jsxs("div",{className:te,children:[u.jsx("svg",{className:ue(re,t.length>=8?oe:le),fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),u.jsx("span",{className:ue(ae,t.length>=8&&se),children:"Mínimo 8 caracteres"})]})]})]}),(l||ke)&&u.jsxs("div",{className:O,children:[u.jsx("svg",{className:M,fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M18.101 12.93a1 1 0 00-1.414-1.414L10 15.586l-6.687-6.687a1 1 0 00-1.414 1.414l8 8a1 1 0 001.414 0l8-8z",clipRule:"evenodd"})}),u.jsx("p",{className:P,children:l||ke})]})]})};
|
|
10
|
+
*/function u(){return l||(l=1,"production"!==process.env.NODE_ENV&&function(){function n(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===S?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case f:return"Fragment";case h:return"Profiler";case g:return"StrictMode";case T:return"Suspense";case v:return"SuspenseList";case k:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case _:return"Portal";case y:return e.displayName||"Context";case x:return(e._context.displayName||"Context")+".Consumer";case b:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case I:return null!==(t=e.displayName||null)?t:n(e.type)||"Memo";case j:t=e._payload,e=e._init;try{return n(e(t))}catch(e){}}return null}function t(e){return""+e}function r(e){try{t(e);var n=!1}catch(e){n=!0}if(n){var r=(n=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),t(e)}}function o(e){if(e===f)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===j)return"<...>";try{var t=n(e);return t?"<"+t+">":"<...>"}catch(e){return"<...>"}}function a(){return Error("react-stack-top-frame")}function l(){var e=n(this.type);return C[e]||(C[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function s(e,t,o,a,s,i){var c,m=t.children;if(void 0!==m)if(a)if(O(m)){for(a=0;a<m.length;a++)u(m[a]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(m);if(N.call(t,"key")){m=n(e);var _=Object.keys(t).filter(function(e){return"key"!==e});a=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",A[m+a]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,m,_,m),A[m+a]=!0)}if(m=null,void 0!==o&&(r(o),m=""+o),function(e){if(N.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return void 0!==e.key}(t)&&(r(t.key),m=""+t.key),"key"in t)for(var f in o={},t)"key"!==f&&(o[f]=t[f]);else o=t;return m&&function(e,n){function t(){d||(d=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(e,n,t,r,o,a){var s=t.ref;return e={$$typeof:p,type:e,key:n,props:t,_owner:r},null!==(void 0!==s?s:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:l}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,m,o,null===(c=w.A)?null:c.getOwner(),s,i)}function u(e){c(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===j&&("fulfilled"===e._payload.status?c(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function c(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var d,m=e,p=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),S=Symbol.for("react.client.reference"),w=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,O=Array.isArray,z=console.createTask?console.createTask:function(){return null},C={},R=(m={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(m,a)(),$=z(o(a)),A={};i.Fragment=f,i.jsx=function(e,n,t){var r=1e4>w.recentlyCreatedOwnerStacks++;return s(e,n,t,!1,r?Error("react-stack-top-frame"):R,r?z(o(e)):$)},i.jsxs=function(e,n,t){var r=1e4>w.recentlyCreatedOwnerStacks++;return s(e,n,t,!0,r?Error("react-stack-top-frame"):R,r?z(o(e)):$)}}()),i}var c,d,m,p=(s||(s=1,"production"===process.env.NODE_ENV?o.exports=function(){if(t)return a;t=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(n,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:e,type:n,key:o,ref:void 0!==t?t:null,props:r}}return a.Fragment=n,a.jsx=r,a.jsxs=r,a}():o.exports=u()),o.exports),_={exports:{}},f={},g={};var h=(m||(m=1,"production"===process.env.NODE_ENV?_.exports=function(){if(c)return f;c=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(n,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:e,type:n,key:o,ref:void 0!==t?t:null,props:r}}return f.Fragment=n,f.jsx=t,f.jsxs=t,f}():_.exports=(d||(d=1,"production"!==process.env.NODE_ENV&&function(){function n(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===S?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case _:return"Fragment";case h:return"Profiler";case f:return"StrictMode";case T:return"Suspense";case v:return"SuspenseList";case k:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case p:return"Portal";case y:return e.displayName||"Context";case x:return(e._context.displayName||"Context")+".Consumer";case b:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case I:return null!==(t=e.displayName||null)?t:n(e.type)||"Memo";case j:t=e._payload,e=e._init;try{return n(e(t))}catch(e){}}return null}function t(e){return""+e}function r(e){try{t(e);var n=!1}catch(e){n=!0}if(n){var r=(n=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),t(e)}}function o(e){if(e===_)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===j)return"<...>";try{var t=n(e);return t?"<"+t+">":"<...>"}catch(e){return"<...>"}}function a(){return Error("react-stack-top-frame")}function l(){var e=n(this.type);return C[e]||(C[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function s(e,t,o,a,s,u){var d,p=t.children;if(void 0!==p)if(a)if(O(p)){for(a=0;a<p.length;a++)i(p[a]);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else i(p);if(N.call(t,"key")){p=n(e);var _=Object.keys(t).filter(function(e){return"key"!==e});a=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",A[p+a]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,p,_,p),A[p+a]=!0)}if(p=null,void 0!==o&&(r(o),p=""+o),function(e){if(N.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return void 0!==e.key}(t)&&(r(t.key),p=""+t.key),"key"in t)for(var f in o={},t)"key"!==f&&(o[f]=t[f]);else o=t;return p&&function(e,n){function t(){c||(c=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(e,n,t,r,o,a){var s=t.ref;return e={$$typeof:m,type:e,key:n,props:t,_owner:r},null!==(void 0!==s?s:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:l}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,p,o,null===(d=w.A)?null:d.getOwner(),s,u)}function i(e){u(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===j&&("fulfilled"===e._payload.status?u(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===m}var c,d=e,m=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),S=Symbol.for("react.client.reference"),w=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,O=Array.isArray,z=console.createTask?console.createTask:function(){return null},C={},R=(d={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(d,a)(),$=z(o(a)),A={};g.Fragment=_,g.jsx=function(e,n,t){var r=1e4>w.recentlyCreatedOwnerStacks++;return s(e,n,t,!1,r?Error("react-stack-top-frame"):R,r?z(o(e)):$)},g.jsxs=function(e,n,t){var r=1e4>w.recentlyCreatedOwnerStacks++;return s(e,n,t,!0,r?Error("react-stack-top-frame"):R,r?z(o(e)):$)}}()),g)),_.exports);function x({className:e="",size:n="md"}){const t=`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[n]} ${e}`;return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:t,"aria-label":"Check",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}const y=({className:e="",size:n="md"})=>{const t=`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[n]} ${e}`;return h.jsx("svg",{className:t,viewBox:"0 0 20 20",fill:"currentColor","aria-label":"Error",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})},b=({className:e="",size:n="md"})=>{const t=`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[n]} ${e}`;return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-label":"Info",children:h.jsx("path",{d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})},T={outlined:"material-symbols-outlined",rounded:"material-symbols-rounded",sharp:"material-symbols-sharp"},v=r.forwardRef(({name:e,variant:n="outlined",size:t="md",fill:r=0,weight:o=400,grade:a=0,opticalSize:l=24,style:s,className:i,...u},c)=>{const d=(e=>"number"==typeof e?e:"sm"===e?16:"md"===e?20:24)(t),m=`"FILL" ${r}, "wght" ${o}, "GRAD" ${a}, "opsz" ${l}`;return h.jsx("span",{ref:c,"aria-hidden":"true",className:T[n]+(i?` ${i}`:""),style:{fontVariationSettings:m,fontSize:d,lineHeight:1,display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",...s},...u,children:e})});v.displayName="MaterialIcon";var I="TextInput-module_container__QXVA9",j="TextInput-module_label__GGFxk",k="TextInput-module_required__qlHAH",S="TextInput-module_inputContainer__-zaWR",w="TextInput-module_icon__F1AYg",N="TextInput-module_input__I8TSn",O="TextInput-module_inputWithIcon__TDgMC",z="TextInput-module_inputWithCharCount__qgvqA",C="TextInput-module_inputError__-Ga78",R="TextInput-module_inputSuccess__xsjt7",$="TextInput-module_charCount__RyuVm",A="TextInput-module_charCountNormal__LCUr7",E="TextInput-module_charCountNear__OKroK",P="TextInput-module_charCountLimit__iaB20",q="TextInput-module_charCountIcon__lRD-4",L="TextInput-module_charProgressBar__Wva8D",V="TextInput-module_charProgress__ZUsGs",F="TextInput-module_charProgressNormal__TdFY4",M="TextInput-module_charProgressNear__beyMs",U="TextInput-module_charProgressLimit__Vr6d-",B="TextInput-module_hint__iZiig",D="TextInput-module_requiredHelper__TUGsU",Z="TextInput-module_validationMessage__3g-wc",G="TextInput-module_validationIcon__q5LT6",W="TextInput-module_validationText__-qAuu",Y="TextInput-module_validEmail__Ya1tf",K="TextInput-module_emailSuggestion__ZzQkZ",J="TextInput-module_suggestionButton__Rsxt8",Q="TextInput-module_error__ewnmB",H="TextInput-module_errorIcon__JkIpb",X="TextInput-module_errorText__ba7lR",ee="TextInput-module_passwordStrength__ICyJU",ne="TextInput-module_strengthBar__3c8Yf",te="TextInput-module_strengthSegment__76ih4",re="TextInput-module_strengthSegmentInactive__RK1Q8",oe="TextInput-module_strengthSegmentWeak__BFvgT",ae="TextInput-module_strengthSegmentFair__AOJW5",le="TextInput-module_strengthSegmentGood__uGgTx",se="TextInput-module_strengthSegmentStrong__vP5Yi",ie="TextInput-module_strengthSegmentVeryStrong__4Tull",ue="TextInput-module_strengthLabel__PpEO9",ce="TextInput-module_strengthText__jfVUh",de="TextInput-module_strengthValue__04hhw",me="TextInput-module_strengthValueWeak__8Ek8Q",pe="TextInput-module_strengthValueFair__70N63",_e="TextInput-module_strengthValueGood__NgsOd",fe="TextInput-module_strengthValueStrong__qaKsi",ge="TextInput-module_strengthValueVeryStrong__80d9m",he="TextInput-module_requirements__eD6oz",xe="TextInput-module_requirement__KoZx2",ye="TextInput-module_requirementIcon__VjQXJ",be="TextInput-module_requirementIconMet__UNZFD",Te="TextInput-module_requirementIconUnmet__1MF9h",ve="TextInput-module_requirementText__fFcdn",Ie="TextInput-module_requirementTextMet__eGbSi";!function(e,n){void 0===n&&(n={});var t=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("/* Container */\n.TextInput-module_container__QXVA9 {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n/* Label */\n.TextInput-module_label__GGFxk {\n display: block;\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 500;\n color: #374151;\n}\n\n.TextInput-module_required__qlHAH {\n color: #ef4444;\n margin-left: 0.25rem;\n}\n\n/* Input container */\n.TextInput-module_inputContainer__-zaWR {\n position: relative;\n}\n\n/* Icon */\n.TextInput-module_icon__F1AYg {\n position: absolute;\n left: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n color: #9ca3af;\n pointer-events: none;\n display: flex;\n align-items: center;\n}\n\n/* Input */\n.TextInput-module_input__I8TSn {\n width: 100%;\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n border: 2px solid #d1d5db;\n transition: all 150ms ease;\n outline: none;\n font-weight: 500;\n color: #111827;\n}\n\n.TextInput-module_input__I8TSn::-moz-placeholder {\n color: #9ca3af;\n}\n\n.TextInput-module_input__I8TSn::placeholder {\n color: #9ca3af;\n}\n\n.TextInput-module_inputWithIcon__TDgMC {\n padding-left: 2.5rem;\n}\n\n.TextInput-module_inputWithCharCount__qgvqA {\n padding-right: 5rem;\n}\n\n.TextInput-module_input__I8TSn:hover:not(:disabled) {\n border-color: #9ca3af;\n}\n\n.TextInput-module_input__I8TSn:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);\n}\n\n.TextInput-module_input__I8TSn:disabled {\n background: #f3f4f6;\n color: #6b7280;\n cursor: not-allowed;\n}\n\n.TextInput-module_inputError__-Ga78 {\n border-color: #ef4444;\n}\n\n.TextInput-module_inputError__-Ga78:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);\n}\n\n.TextInput-module_inputSuccess__xsjt7 {\n border-color: #10b981;\n}\n\n.TextInput-module_inputSuccess__xsjt7:focus {\n border-color: #10b981;\n box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);\n}\n\n/* Character count */\n.TextInput-module_charCount__RyuVm {\n position: absolute;\n right: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n font-size: 0.75rem;\n line-height: 1rem;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n}\n\n.TextInput-module_charCountNormal__LCUr7 {\n color: #6b7280;\n}\n\n.TextInput-module_charCountNear__OKroK {\n color: #d97706;\n}\n\n.TextInput-module_charCountLimit__iaB20 {\n color: #dc2626;\n}\n\n.TextInput-module_charCountIcon__lRD-4 {\n width: 1rem;\n height: 1rem;\n}\n\n/* Progress bar */\n.TextInput-module_charProgressBar__Wva8D {\n width: 100%;\n height: 0.25rem;\n background: #e5e7eb;\n border-radius: 9999px;\n overflow: hidden;\n}\n\n.TextInput-module_charProgress__ZUsGs {\n height: 100%;\n transition: all 150ms ease;\n border-radius: 9999px;\n}\n\n.TextInput-module_charProgressNormal__TdFY4 {\n background: #3b82f6;\n}\n\n.TextInput-module_charProgressNear__beyMs {\n background: #f59e0b;\n}\n\n.TextInput-module_charProgressLimit__Vr6d- {\n background: #ef4444;\n}\n\n/* Hint text */\n.TextInput-module_hint__iZiig {\n font-size: 0.75rem;\n line-height: 1rem;\n color: #6b7280;\n margin-top: 0.25rem;\n}\n\n.TextInput-module_requiredHelper__TUGsU {\n font-size: 0.75rem;\n line-height: 1rem;\n color: #6b7280;\n margin-top: 0.25rem;\n}\n\n/* Validation messages */\n.TextInput-module_validationMessage__3g-wc {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin-top: 0.25rem;\n}\n\n.TextInput-module_validationIcon__q5LT6 {\n width: 1rem;\n height: 1rem;\n flex-shrink: 0;\n}\n\n.TextInput-module_validationText__-qAuu {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.TextInput-module_validEmail__Ya1tf .TextInput-module_validationIcon__q5LT6 {\n color: #10b981;\n}\n\n.TextInput-module_validEmail__Ya1tf .TextInput-module_validationText__-qAuu {\n color: #059669;\n}\n\n.TextInput-module_emailSuggestion__ZzQkZ .TextInput-module_validationIcon__q5LT6 {\n color: #3b82f6;\n}\n\n.TextInput-module_emailSuggestion__ZzQkZ .TextInput-module_validationText__-qAuu {\n color: #2563eb;\n}\n\n.TextInput-module_suggestionButton__Rsxt8 {\n font-weight: 600;\n text-decoration: underline;\n background: none;\n border: none;\n color: inherit;\n cursor: pointer;\n padding: 0;\n}\n\n.TextInput-module_suggestionButton__Rsxt8:hover {\n color: #1e40af;\n}\n\n/* Error message */\n.TextInput-module_error__ewnmB {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n margin-top: 0.25rem;\n}\n\n.TextInput-module_errorIcon__JkIpb {\n width: 1rem;\n height: 1rem;\n color: #ef4444;\n flex-shrink: 0;\n margin-top: 0.125rem;\n}\n\n.TextInput-module_errorText__ba7lR {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: #dc2626;\n}\n\n/* Password strength */\n.TextInput-module_passwordStrength__ICyJU {\n margin-top: 0.5rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.TextInput-module_strengthBar__3c8Yf {\n display: flex;\n gap: 0.25rem;\n}\n\n.TextInput-module_strengthSegment__76ih4 {\n height: 0.375rem;\n flex: 1;\n border-radius: 9999px;\n transition: background-color 150ms ease;\n}\n\n.TextInput-module_strengthSegmentInactive__RK1Q8 {\n background: #e5e7eb;\n}\n\n.TextInput-module_strengthSegmentWeak__BFvgT {\n background: #ef4444;\n}\n\n.TextInput-module_strengthSegmentFair__AOJW5 {\n background: #f59e0b;\n}\n\n.TextInput-module_strengthSegmentGood__uGgTx {\n background: #eab308;\n}\n\n.TextInput-module_strengthSegmentStrong__vP5Yi {\n background: #84cc16;\n}\n\n.TextInput-module_strengthSegmentVeryStrong__4Tull {\n background: #10b981;\n}\n\n.TextInput-module_strengthLabel__PpEO9 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.TextInput-module_strengthText__jfVUh {\n font-size: 0.75rem;\n line-height: 1rem;\n color: #4b5563;\n}\n\n.TextInput-module_strengthValue__04hhw {\n font-weight: 600;\n}\n\n.TextInput-module_strengthValueWeak__8Ek8Q {\n color: #dc2626;\n}\n\n.TextInput-module_strengthValueFair__70N63 {\n color: #d97706;\n}\n\n.TextInput-module_strengthValueGood__NgsOd {\n color: #ca8a04;\n}\n\n.TextInput-module_strengthValueStrong__qaKsi {\n color: #65a30d;\n}\n\n.TextInput-module_strengthValueVeryStrong__80d9m {\n color: #059669;\n}\n\n/* Requirements checklist */\n.TextInput-module_requirements__eD6oz {\n font-size: 0.75rem;\n line-height: 1rem;\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n padding: 0.5rem;\n background: #f9fafb;\n border-radius: 0.375rem;\n border: 1px solid #e5e7eb;\n}\n\n.TextInput-module_requirement__KoZx2 {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.TextInput-module_requirementIcon__VjQXJ {\n width: 0.875rem;\n height: 0.875rem;\n flex-shrink: 0;\n}\n\n.TextInput-module_requirementIconMet__UNZFD {\n color: #10b981;\n}\n\n.TextInput-module_requirementIconUnmet__1MF9h {\n color: #d1d5db;\n}\n\n.TextInput-module_requirementText__fFcdn {\n color: #6b7280;\n}\n\n.TextInput-module_requirementTextMet__eGbSi {\n color: #374151;\n}\n");const je=(...e)=>e.filter(Boolean).join(" "),ke=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;module.exports=({label:n,value:t,onChange:r,placeholder:o,error:a,required:l=!1,disabled:s=!1,type:i="text",className:u="",hint:c,maxLength:d,minLength:m,pattern:_,icon:f,onBlur:g,onFocus:h,autoComplete:T,validateEmail:v=!1,showPasswordStrength:Se=!1,requiredMessage:we,emailValidMessage:Ne,emailInvalidMessage:Oe,emailSuggestionMessage:ze,strengthLabels:Ce,strengthLabelPrefix:Re,requirementsLabels:$e})=>{const[Ae,Ee]=e.useState(!1),Pe=e.useMemo(()=>v&&t?(e=>{if(!e||!e.includes("@"))return null;const[n,t]=e.split("@");if(!t)return null;const r={"gmial.com":"gmail.com","gmai.com":"gmail.com","gmil.com":"gmail.com","hotmial.com":"hotmail.com","hotmal.com":"hotmail.com","outlok.com":"outlook.com","yahooo.com":"yahoo.com","yaho.com":"yahoo.com"};return r[t.toLowerCase()]?`${n}@${r[t.toLowerCase()]}`:null})(t):null,[v,t]),qe=e.useMemo(()=>{if(!v||!t)return null;return ke.test(t)&&!(null!==Pe)},[v,t,Pe]),Le=v&&t&&!qe&&!Pe,Ve=Le&&Oe||null,Fe=!m||t.length>=m,Me=!d||t.length<=d,Ue=!_||new RegExp(_).test(t),Be=Boolean(t&&!a&&!Le&&!Pe&&(!l||t.length>0)&&(!v||qe)&&Fe&&Me&&Ue),De=e.useMemo(()=>"password"===i&&Se?(e=>{if(!e)return{score:0,strength:"none"};let n=0;const t=/[A-Z]/.test(e);return/[a-z]/.test(e)&&n++,t&&n++,/\d/.test(e)&&n++,/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(e)&&n++,e.length>=8&&n++,n<=1?{score:n,strength:"weak"}:n<=2?{score:n,strength:"fair"}:n<=3?{score:n,strength:"good"}:4===n?{score:n,strength:"strong"}:{score:n,strength:"very-strong"}})(t):null,[i,t,Se]),Ze=d&&"text"===i&&t,Ge=t.length,We=d?Ge/d*100:0,Ye=We>80,Ke=We>=100;return p.jsxs("div",{className:je(I,u),"data-testid":"text-input",children:[n&&p.jsxs("label",{className:j,children:[n,l&&p.jsx("span",{className:k,children:"*"})]}),p.jsxs("div",{className:S,children:[f&&!Ae&&p.jsx("div",{className:w,children:f}),p.jsx("input",{type:i,value:t,onChange:e=>r(e.target.value),onFocus:()=>{Ee(!0),h?.()},onBlur:()=>{Ee(!1),g?.()},placeholder:o,disabled:s,maxLength:d,minLength:m,pattern:_,autoComplete:T,className:je(N,f?O:void 0,Ze?z:void 0,a||Le?C:void 0,s||a||Ve||!Be?void 0:R),"data-testid":"input-field","data-error":!!a||!!Le}),Ze&&p.jsxs("div",{className:je($,Ke?P:Ye?E:A),"data-testid":"char-count",children:[p.jsxs("div",{children:[Ge,"/",d]}),Ke&&p.jsx(y,{className:q,size:"sm"})]})]}),Ze&&d>20&&p.jsx("div",{className:L,children:p.jsx("div",{className:je(V,Ke?U:Ye?M:F),style:{width:`${Math.min(We,100)}%`}})}),c&&!a&&!Le&&p.jsx("p",{className:B,children:c}),l&&!t&&!a&&!Le&&we&&p.jsx("p",{className:D,children:we}),v&&t&&qe&&Ne&&p.jsxs("div",{className:je(Z,Y),children:[p.jsx(x,{className:G,size:"sm"}),p.jsx("p",{className:W,children:Ne})]}),Pe&&!a&&ze&&p.jsxs("div",{className:je(Z,K),children:[p.jsx(b,{className:G,size:"sm"}),p.jsxs("p",{className:W,children:[ze.replace("{suggestion}",Pe),p.jsx("button",{type:"button",onClick:()=>r(Pe),className:J,children:Pe})]})]}),De&&De.score>0&&p.jsxs("div",{className:ee,children:[p.jsx("div",{className:ne,children:[0,1,2,3,4].map(e=>p.jsx("div",{className:je(te,e<De.score?"weak"===De.strength?oe:"fair"===De.strength?ae:"good"===De.strength?le:"strong"===De.strength?se:ie:re)},e))}),(Re||Ce?.[De.strength])&&p.jsx("div",{className:ue,children:p.jsxs("p",{className:ce,children:[Re&&`${Re} `,p.jsx("span",{className:je(de,"weak"===De.strength?me:"fair"===De.strength?pe:"good"===De.strength?_e:"strong"===De.strength?fe:ge),children:Ce?.[De.strength]})]})}),$e&&p.jsxs("div",{className:he,children:[$e.lowercase&&p.jsxs("div",{className:xe,children:[p.jsx(x,{className:je(ye,/[a-z]/.test(t)?be:Te),size:"sm"}),p.jsx("span",{className:je(ve,/[a-z]/.test(t)&&Ie),children:$e.lowercase})]}),$e.uppercase&&p.jsxs("div",{className:xe,children:[p.jsx(x,{className:je(ye,/[A-Z]/.test(t)?be:Te),size:"sm"}),p.jsx("span",{className:je(ve,/[A-Z]/.test(t)&&Ie),children:$e.uppercase})]}),$e.number&&p.jsxs("div",{className:xe,children:[p.jsx(x,{className:je(ye,/\d/.test(t)?be:Te),size:"sm"}),p.jsx("span",{className:je(ve,/\d/.test(t)&&Ie),children:$e.number})]}),$e.special&&p.jsxs("div",{className:xe,children:[p.jsx(x,{className:je(ye,/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(t)?be:Te),size:"sm"}),p.jsx("span",{className:je(ve,/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(t)&&Ie),children:$e.special})]}),$e.minLength&&p.jsxs("div",{className:xe,children:[p.jsx(x,{className:je(ye,t.length>=8?be:Te),size:"sm"}),p.jsx("span",{className:je(ve,t.length>=8&&Ie),children:$e.minLength})]})]})]}),(a||Le&&Oe)&&p.jsxs("div",{className:Q,children:[p.jsx(y,{className:H,size:"sm"}),p.jsx("p",{className:X,children:a||Oe})]})]})};
|
|
11
11
|
//# sourceMappingURL=index.cjs.js.map
|