@adam-milo/ui 1.0.65 β 1.0.67
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/index10.cjs +1 -1
- package/dist/index10.js +2 -2
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +10 -10
- package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.types.d.ts +2 -0
- package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.types.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.types.d.ts +3 -0
- package/dist/src/components/forms/phone-input/PhoneInput.types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index10.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index59.cjs"),n=require("./index61.cjs"),l=t.forwardRef(({allowHyphen:l=!1,allowUnderscore:r=!1,allowSpace:s=!1,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index59.cjs"),n=require("./index61.cjs"),l=t.forwardRef(({allowHyphen:l=!1,allowUnderscore:r=!1,allowSpace:s=!1,allowAllChars:u=!1,minLength:i,maxLength:c,validate:o,onChange:p,"data-cy":d,"data-testid":h,...g},m)=>{const f=t.useRef(null),v=n.useMergedRef(m,f),x=t.useMemo(()=>{let e="^[a-zA-Z0-9";return l&&(e+="\\-"),r&&(e+="_"),s&&(e+=" "),e+="]*$",new RegExp(e)},[l,r,s]),y=t.useMemo(()=>{let e="[a-zA-Z0-9";return l&&(e+="\\-"),r&&(e+="_"),s&&(e+=" "),e+="]",new RegExp(e)},[l,r,s]),b=t.useCallback(e=>{if(e){if(!u&&!x.test(e)){let e="letters and numbers";const t=[];return l&&t.push("hyphens"),r&&t.push("underscores"),s&&t.push("spaces"),t.length>0&&(e+=`, ${t.join(", ")}`),`Only ${e} are allowed`}return void 0!==i&&e.length<i?`Must be at least ${i} characters`:void 0!==c&&e.length>c?`Must be at most ${c} characters`:void 0}},[u,x,i,c,l,r,s]),w=t.useCallback(e=>o?b(e)||o(e):b(e),[b,o]),[j,R]=t.useState(null);t.useEffect(()=>{null!==j&&f.current&&(f.current.setSelectionRange(j,j),R(null))},[g.value,j]);const S=t.useCallback(e=>{if(u)return void p?.(e);const t=e.target,a=t.value,n=t.selectionStart||0,l=a.split("").filter(e=>y.test(e)).join(""),r=n-a.slice(0,n).split("").filter(e=>!y.test(e)).length;t.value=l;void 0!==g.value?R(r):t.setSelectionRange(r,r),p?.(e)},[u,y,p,g.value]);return e.jsx(a.Input,{ref:v,type:"text",minLength:i,maxLength:c,validate:w,onChange:S,"data-cy":d||"alphanumeric-input","data-testid":h||"alphanumeric-input",...g})});l.displayName="AlphanumericInput",exports.AlphanumericInput=l;
|
package/dist/index10.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{forwardRef as t,useRef as n,useMemo as a,useCallback as l,useState as r,useEffect as s}from"react";import{Input as i}from"./index59.js";import{useMergedRef as o}from"./index61.js";const u=t(({allowHyphen:t=!1,allowUnderscore:u=!1,allowSpace:c=!1,
|
|
2
|
-
return e(i,{ref:
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{forwardRef as t,useRef as n,useMemo as a,useCallback as l,useState as r,useEffect as s}from"react";import{Input as i}from"./index59.js";import{useMergedRef as o}from"./index61.js";const u=t(({allowHyphen:t=!1,allowUnderscore:u=!1,allowSpace:c=!1,allowAllChars:p=!1,minLength:h,maxLength:d,validate:m,onChange:g,"data-cy":v,"data-testid":f,...x},w)=>{const y=n(null),j=o(w,y),$=a(()=>{let e="^[a-zA-Z0-9";return t&&(e+="\\-"),u&&(e+="_"),c&&(e+=" "),e+="]*$",new RegExp(e)},[t,u,c]),A=a(()=>{let e="[a-zA-Z0-9";return t&&(e+="\\-"),u&&(e+="_"),c&&(e+=" "),e+="]",new RegExp(e)},[t,u,c]),L=l(e=>{if(e){if(!p&&!$.test(e)){let e="letters and numbers";const n=[];return t&&n.push("hyphens"),u&&n.push("underscores"),c&&n.push("spaces"),n.length>0&&(e+=`, ${n.join(", ")}`),`Only ${e} are allowed`}return void 0!==h&&e.length<h?`Must be at least ${h} characters`:void 0!==d&&e.length>d?`Must be at most ${d} characters`:void 0}},[p,$,h,d,t,u,c]),R=l(e=>m?L(e)||m(e):L(e),[L,m]),[S,b]=r(null);s(()=>{null!==S&&y.current&&(y.current.setSelectionRange(S,S),b(null))},[x.value,S]);const C=l(e=>{if(p)return void g?.(e);const t=e.target,n=t.value,a=t.selectionStart||0,l=n.split("").filter(e=>A.test(e)).join(""),r=a-n.slice(0,a).split("").filter(e=>!A.test(e)).length;t.value=l;void 0!==x.value?b(r):t.setSelectionRange(r,r),g?.(e)},[p,A,g,x.value]);/* @__PURE__ */
|
|
2
|
+
return e(i,{ref:j,type:"text",minLength:h,maxLength:d,validate:R,onChange:C,"data-cy":v||"alphanumeric-input","data-testid":f||"alphanumeric-input",...x})});u.displayName="AlphanumericInput";export{u as AlphanumericInput};
|
package/dist/index14.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("react-dom"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("react-dom"),n=require("./index52.cjs"),r=require("@adam-milo/icons"),s=require("./index54.cjs"),o=require("./index65.cjs"),i={name:"United States",dialCode:"+1",flag:"πΊπΈ",mask:s.defaultPhoneMask},l=t.forwardRef(({label:l,error:d,helperText:c,fullWidth:u=!0,value:p="",onChange:h,countryCode:y,initialCountryCode:m,onCountryChange:f,countries:g,enableFormatting:x=!0,onValidationChange:w,disabled:S,required:b,placeholder:$,id:v,"data-cy":C,"data-testid":k,className:j,onFocus:D,onBlur:N,...P},E)=>{const[L,M]=t.useState(!1),[q,I]=t.useState(!1),[W,F]=t.useState(0),[R,B]=t.useState({top:0,left:0,width:0}),[T,V]=t.useState(()=>y??m??"US"),z=y??T,A=t.useId(),K=v||A,U=`${K}-error`,H=`${K}-helper`,O=`${K}-listbox`,G=t.useRef(null),J=t.useRef(null),Q=t.useRef(null),X=t.useRef(null),Y=C||"phone-input",Z=k||"phone-input",_=g.find(e=>e.code===z)||g[0]||i,ee=_.mask??s.defaultPhoneMask,te=$??ee.placeholder,ae=l&&b&&!l.includes("*")?`${l}*`:l,ne=_.dialCode.replace(/\D/g,"").length,re=s.getPhoneDigits(p),se=p.startsWith("+")?re.slice(ne):re,oe=x?s.formatWithMask(se,ee):se;t.useLayoutEffect(()=>{if(!L||!J.current)return;const e=()=>{if(J.current){const e=J.current.getBoundingClientRect();B({top:e.bottom+12,left:e.left,width:Math.max(e.width,320)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[L]),t.useEffect(()=>{const e=e=>{const t=e.target,a=G.current?.contains(t),n=Q.current?.contains(t);a||n||M(!1)};return L&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[L]);const ie=t.useCallback(e=>{void 0===y&&V(e.code),f?.(e);const t=s.getPhoneDigits(p),a=_.dialCode.replace(/\D/g,"").length,n=p.startsWith("+")?t.slice(a):t;h?.(`${e.dialCode}${n}`),M(!1),setTimeout(()=>{const e=G.current?.querySelector("input");e?.focus()},0)},[y,f,h,p,_.dialCode]),le=t.useCallback(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),F(e=>Math.min(e+1,g.length-1));break;case"ArrowUp":e.preventDefault(),F(e=>Math.max(e-1,0));break;case"Enter":case" ":e.preventDefault(),ie(g[W]);break;case"Escape":e.preventDefault(),M(!1),X.current?.focus();break;case"Tab":M(!1)}},[g,W,ie]),de=S?"disabled":d?"error":q||L?"focus":"idle";return e.jsxs("div",{ref:G,className:n.cn(o.wrapperStyles,u&&o.wrapperFullWidthStyles),"data-cy":`${Y}-wrapper`,"data-testid":`${Z}-wrapper`,children:[l&&e.jsx("label",{htmlFor:K,className:o.labelStyles,"data-cy":`${Y}-label`,"data-testid":`${Z}-label`,children:ae}),e.jsxs("div",{ref:J,className:n.cn(o.containerBaseStyles,u&&o.containerFullWidthStyles,"focus"===de&&o.containerFocusStyles,"error"===de&&o.containerErrorStyles,"disabled"===de&&o.containerDisabledStyles,"idle"===de&&o.containerIdleStyles),"data-state":de,"data-cy":`${Y}-container`,"data-testid":`${Z}-container`,children:[e.jsxs("button",{ref:X,type:"button",className:o.triggerStyles,onClick:()=>!S&&M(!L),onKeyDown:e=>{if("Enter"===e.key||" "===e.key||"ArrowDown"===e.key){e.preventDefault(),M(!0);const t=g.findIndex(e=>e.code===z);F(-1===t?0:t)}},disabled:S,"aria-haspopup":"listbox","aria-expanded":L,"aria-controls":O,"aria-label":`Select country. Current: ${_.name}`,"data-cy":`${Y}-country-trigger`,"data-testid":`${Z}-country-trigger`,children:[e.jsx("span",{className:o.flagStyles,"data-cy":`${Y}-flag`,"data-testid":`${Z}-flag`,children:_.flag}),e.jsx(r.Icon,{name:"ChevronDownIcon",size:"sm",color:q||L?"clickable":"text",decorative:!0,"data-cy":`${Y}-chevron`})]}),e.jsx("span",{className:o.dialCodeStyles,"data-cy":`${Y}-dial-code`,"data-testid":`${Z}-dial-code`,children:_.dialCode}),e.jsx("input",{ref:E,id:K,type:"tel",inputMode:"numeric",value:oe,onChange:e=>{const t=e.target.value;if(x){const e=s.getPhoneDigits(t).slice(0,ee.maxLength);h?.(`${_.dialCode}${e}`);const a=e.length===ee.maxLength;w?.(a)}else{const e=t.replace(/[^0-9]/g,"");h?.(`${_.dialCode}${e}`);const a=e.length===ee.maxLength;w?.(a)}},onFocus:e=>{I(!0),D?.(e)},onBlur:e=>{I(!1),N?.(e)},placeholder:te,disabled:S,required:b,className:n.cn(o.inputStyles,j),"aria-invalid":d?"true":"false","aria-required":b?"true":void 0,"aria-describedby":d?U:c?H:void 0,"data-cy":Y,"data-testid":Z,...P})]}),L&&a.createPortal(e.jsx("div",{ref:Q,id:O,role:"listbox","aria-label":"Select country",className:o.dropdownStyles,style:{top:R.top,left:R.left,width:R.width,minWidth:"20rem"},tabIndex:-1,onKeyDown:le,"data-cy":`${Y}-dropdown`,"data-testid":`${Z}-dropdown`,children:e.jsx("div",{className:o.dropdownViewportStyles,children:g.map((t,a)=>e.jsxs("div",{role:"option","aria-selected":t.code===z,className:n.cn(o.optionBaseStyles,a===W&&o.optionHighlightedStyles,t.code===z&&o.optionSelectedStyles),onClick:()=>ie(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ie(t))},onMouseEnter:()=>F(a),tabIndex:a===W?0:-1,"data-cy":`${Y}-option-${t.code.toLowerCase()}`,"data-testid":`${Z}-option-${t.code.toLowerCase()}`,children:[e.jsx("span",{className:o.optionFlagStyles,children:t.flag}),e.jsx("span",{className:o.optionNameStyles,children:t.name}),e.jsx("span",{className:o.optionDialCodeStyles,children:t.dialCode})]},t.code))})}),document.body),d&&e.jsx("span",{id:U,className:o.errorStyles,role:"alert","data-cy":`${Y}-error`,"data-testid":`${Z}-error`,children:d}),c&&!d&&e.jsx("span",{id:H,className:o.helperStyles,"data-cy":`${Y}-helper`,"data-testid":`${Z}-helper`,children:c})]})});l.displayName="PhoneInput",exports.defaultPhoneMask=s.defaultPhoneMask,exports.formatWithMask=s.formatWithMask,exports.getPhoneDigits=s.getPhoneDigits,exports.isValidPhoneLength=s.isValidPhoneLength,exports.PhoneInput=l;
|
package/dist/index14.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useState as r,useId as n,useRef as o,useLayoutEffect as d,useEffect as i,useCallback as l}from"react";import{createPortal as c}from"react-dom";import{cn as s}from"./index52.js";import{Icon as
|
|
2
|
-
return e("div",{ref:
|
|
3
|
-
/* @__PURE__ */e("div",{ref:
|
|
4
|
-
/* @__PURE__ */e("button",{ref:
|
|
5
|
-
/* @__PURE__ */t("span",{className:w,"data-cy":`${
|
|
6
|
-
/* @__PURE__ */t(
|
|
7
|
-
/* @__PURE__ */t("span",{className:v,"data-cy":`${
|
|
8
|
-
/* @__PURE__ */t("input",{ref:
|
|
9
|
-
/* @__PURE__ */t("div",{ref:
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useState as r,useId as n,useRef as o,useLayoutEffect as d,useEffect as i,useCallback as l}from"react";import{createPortal as c}from"react-dom";import{cn as s}from"./index52.js";import{Icon as u}from"@adam-milo/icons";import{defaultPhoneMask as p,getPhoneDigits as m,formatWithMask as h}from"./index54.js";import{isValidPhoneLength as f}from"./index54.js";import{labelStyles as y,triggerStyles as $,flagStyles as w,dialCodeStyles as v,dropdownStyles as b,dropdownViewportStyles as g,optionFlagStyles as C,optionNameStyles as x,optionDialCodeStyles as N,optionSelectedStyles as k,optionHighlightedStyles as D,optionBaseStyles as E,errorStyles as L,helperStyles as j,inputStyles as I,containerIdleStyles as M,containerDisabledStyles as S,containerErrorStyles as q,containerFocusStyles as F,containerFullWidthStyles as W,containerBaseStyles as z,wrapperFullWidthStyles as A,wrapperStyles as B}from"./index65.js";const K={name:"United States",dialCode:"+1",flag:"πΊπΈ",mask:p},T=a(({label:a,error:f,helperText:T,fullWidth:U=!0,value:P="",onChange:R,countryCode:V,initialCountryCode:G,onCountryChange:H,countries:J,enableFormatting:O=!0,onValidationChange:Q,disabled:X,required:Y,placeholder:Z,id:_,"data-cy":ee,"data-testid":te,className:ae,onFocus:re,onBlur:ne,...oe},de)=>{const[ie,le]=r(!1),[ce,se]=r(!1),[ue,pe]=r(0),[me,he]=r({top:0,left:0,width:0}),[fe,ye]=r(()=>V??G??"US"),$e=V??fe,we=n(),ve=_||we,be=`${ve}-error`,ge=`${ve}-helper`,Ce=`${ve}-listbox`,xe=o(null),Ne=o(null),ke=o(null),De=o(null),Ee=ee||"phone-input",Le=te||"phone-input",je=J.find(e=>e.code===$e)||J[0]||K,Ie=je.mask??p,Me=Z??Ie.placeholder,Se=a&&Y&&!a.includes("*")?`${a}*`:a,qe=je.dialCode.replace(/\D/g,"").length,Fe=m(P),We=P.startsWith("+")?Fe.slice(qe):Fe,ze=O?h(We,Ie):We;d(()=>{if(!ie||!Ne.current)return;const e=()=>{if(Ne.current){const e=Ne.current.getBoundingClientRect();he({top:e.bottom+12,left:e.left,width:Math.max(e.width,320)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[ie]),i(()=>{const e=e=>{const t=e.target,a=xe.current?.contains(t),r=ke.current?.contains(t);a||r||le(!1)};return ie&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[ie]);const Ae=l(e=>{void 0===V&&ye(e.code),H?.(e);const t=m(P),a=je.dialCode.replace(/\D/g,"").length,r=P.startsWith("+")?t.slice(a):t;R?.(`${e.dialCode}${r}`),le(!1),setTimeout(()=>{const e=xe.current?.querySelector("input");e?.focus()},0)},[V,H,R,P,je.dialCode]),Be=l(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),pe(e=>Math.min(e+1,J.length-1));break;case"ArrowUp":e.preventDefault(),pe(e=>Math.max(e-1,0));break;case"Enter":case" ":e.preventDefault(),Ae(J[ue]);break;case"Escape":e.preventDefault(),le(!1),De.current?.focus();break;case"Tab":le(!1)}},[J,ue,Ae]),Ke=X?"disabled":f?"error":ce||ie?"focus":"idle";/* @__PURE__ */
|
|
2
|
+
return e("div",{ref:xe,className:s(B,U&&A),"data-cy":`${Ee}-wrapper`,"data-testid":`${Le}-wrapper`,children:[a&&/* @__PURE__ */t("label",{htmlFor:ve,className:y,"data-cy":`${Ee}-label`,"data-testid":`${Le}-label`,children:Se}),
|
|
3
|
+
/* @__PURE__ */e("div",{ref:Ne,className:s(z,U&&W,"focus"===Ke&&F,"error"===Ke&&q,"disabled"===Ke&&S,"idle"===Ke&&M),"data-state":Ke,"data-cy":`${Ee}-container`,"data-testid":`${Le}-container`,children:[
|
|
4
|
+
/* @__PURE__ */e("button",{ref:De,type:"button",className:$,onClick:()=>!X&&le(!ie),onKeyDown:e=>{if("Enter"===e.key||" "===e.key||"ArrowDown"===e.key){e.preventDefault(),le(!0);const t=J.findIndex(e=>e.code===$e);pe(-1===t?0:t)}},disabled:X,"aria-haspopup":"listbox","aria-expanded":ie,"aria-controls":Ce,"aria-label":`Select country. Current: ${je.name}`,"data-cy":`${Ee}-country-trigger`,"data-testid":`${Le}-country-trigger`,children:[
|
|
5
|
+
/* @__PURE__ */t("span",{className:w,"data-cy":`${Ee}-flag`,"data-testid":`${Le}-flag`,children:je.flag}),
|
|
6
|
+
/* @__PURE__ */t(u,{name:"ChevronDownIcon",size:"sm",color:ce||ie?"clickable":"text",decorative:!0,"data-cy":`${Ee}-chevron`})]}),
|
|
7
|
+
/* @__PURE__ */t("span",{className:v,"data-cy":`${Ee}-dial-code`,"data-testid":`${Le}-dial-code`,children:je.dialCode}),
|
|
8
|
+
/* @__PURE__ */t("input",{ref:de,id:ve,type:"tel",inputMode:"numeric",value:ze,onChange:e=>{const t=e.target.value;if(O){const e=m(t).slice(0,Ie.maxLength);R?.(`${je.dialCode}${e}`);const a=e.length===Ie.maxLength;Q?.(a)}else{const e=t.replace(/[^0-9]/g,"");R?.(`${je.dialCode}${e}`);const a=e.length===Ie.maxLength;Q?.(a)}},onFocus:e=>{se(!0),re?.(e)},onBlur:e=>{se(!1),ne?.(e)},placeholder:Me,disabled:X,required:Y,className:s(I,ae),"aria-invalid":f?"true":"false","aria-required":Y?"true":void 0,"aria-describedby":f?be:T?ge:void 0,"data-cy":Ee,"data-testid":Le,...oe})]}),ie&&c(
|
|
9
|
+
/* @__PURE__ */t("div",{ref:ke,id:Ce,role:"listbox","aria-label":"Select country",className:b,style:{top:me.top,left:me.left,width:me.width,minWidth:"20rem"},tabIndex:-1,onKeyDown:Be,"data-cy":`${Ee}-dropdown`,"data-testid":`${Le}-dropdown`,children:/* @__PURE__ */t("div",{className:g,children:J.map((a,r)=>/* @__PURE__ */e("div",{role:"option","aria-selected":a.code===$e,className:s(E,r===ue&&D,a.code===$e&&k),onClick:()=>Ae(a),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ae(a))},onMouseEnter:()=>pe(r),tabIndex:r===ue?0:-1,"data-cy":`${Ee}-option-${a.code.toLowerCase()}`,"data-testid":`${Le}-option-${a.code.toLowerCase()}`,children:[
|
|
10
10
|
/* @__PURE__ */t("span",{className:C,children:a.flag}),
|
|
11
11
|
/* @__PURE__ */t("span",{className:x,children:a.name}),
|
|
12
|
-
/* @__PURE__ */t("span",{className:N,children:a.dialCode})]},a.code))})}),document.body),f&&/* @__PURE__ */t("span",{id:
|
|
12
|
+
/* @__PURE__ */t("span",{className:N,children:a.dialCode})]},a.code))})}),document.body),f&&/* @__PURE__ */t("span",{id:be,className:L,role:"alert","data-cy":`${Ee}-error`,"data-testid":`${Le}-error`,children:f}),T&&!f&&/* @__PURE__ */t("span",{id:ge,className:j,"data-cy":`${Ee}-helper`,"data-testid":`${Le}-helper`,children:T})]})});T.displayName="PhoneInput";export{T as PhoneInput,p as defaultPhoneMask,h as formatWithMask,m as getPhoneDigits,f as isValidPhoneLength};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlphanumericInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/alphanumeric-input/AlphanumericInput.component.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"AlphanumericInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/alphanumeric-input/AlphanumericInput.component.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,eAAO,MAAM,iBAAiB,qHAqK7B,CAAC;AAIF,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -4,6 +4,8 @@ export interface AlphanumericInputProps extends Omit<InputProps, 'type'> {
|
|
|
4
4
|
allowHyphen?: boolean;
|
|
5
5
|
allowUnderscore?: boolean;
|
|
6
6
|
allowSpace?: boolean;
|
|
7
|
+
/** When true, allow any character (no filtering). Use for free-form text. */
|
|
8
|
+
allowAllChars?: boolean;
|
|
7
9
|
minLength?: number;
|
|
8
10
|
maxLength?: number;
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlphanumericInput.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/alphanumeric-input/AlphanumericInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IACtE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"AlphanumericInput.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/alphanumeric-input/AlphanumericInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;IACtE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/phone-input/PhoneInput.component.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA2B1D,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAUnG,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"PhoneInput.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/phone-input/PhoneInput.component.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA2B1D,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAUnG,eAAO,MAAM,UAAU,8GAgYtB,CAAC;AAIF,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -8,7 +8,10 @@ export interface PhoneInputProps extends Omit<InputHTMLAttributes<HTMLInputEleme
|
|
|
8
8
|
fullWidth?: boolean;
|
|
9
9
|
value?: string;
|
|
10
10
|
onChange?: (value: string) => void;
|
|
11
|
+
/** Controlled: current country code (parent must update on selection). */
|
|
11
12
|
countryCode?: string;
|
|
13
|
+
/** Uncontrolled: initial country code. Once user selects another country, internal state takes precedence. */
|
|
14
|
+
initialCountryCode?: string;
|
|
12
15
|
onCountryChange?: (country: Country) => void;
|
|
13
16
|
/** Array of country objects for the selector. Each object: `{ code, name, dialCode, flag }`. */
|
|
14
17
|
countries: Country[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/phone-input/PhoneInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,OAAO,GAAG,UAAU,CAC9B;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,gGAAgG;IAChG,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
1
|
+
{"version":3,"file":"PhoneInput.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/phone-input/PhoneInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,OAAO,GAAG,UAAU,CAC9B;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8GAA8G;IAC9G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,gGAAgG;IAChG,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|