inconel 0.1.18 → 0.1.21

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("react"),j=require("../shared/classNames.cjs");;/* empty css */const B=require("./constants.cjs");;/* empty css */const C=require("./utils.cjs"),I=require("../Svg/Svg.cjs");function O({loading:n=!1,fullWidth:x=!1,variant:y="primary",label:q,buttonType:S,icon:t,iconClassName:M,iconWidth:s,iconHeight:l,iconRight:o=!1,render:v=!0,debounceTime:d,isActive:i,onClick:b,disabled:r,className:g,children:k,size:w="md",pill:A=!1,count:f,progress:m,progressColor:E,...p}){const T=S??y,a=N.useMemo(()=>C.createDebouncedCallback(b,d??0),[b,d]);if(N.useEffect(()=>()=>a.cancel(),[a]),!v)return null;const _=q??k,c=typeof m=="number"?Math.max(0,Math.min(100,m)):null,h=typeof t=="string"&&t?e.jsx("span",{className:j.classNames("inconel-button__icon",o?"inconel-button__icon--right":"inconel-button__icon--left",M),style:{width:s??void 0,height:l??void 0},"aria-hidden":"true",children:e.jsx(I.default,{src:t,renumerateIRIElements:!1,loading:()=>null,fallback:()=>null,beforeInjection:u=>{s&&u.setAttribute("width",String(s)),l&&u.setAttribute("height",String(l)),u.setAttribute("preserveAspectRatio","xMidYMid meet")}})}):null;return e.jsxs("button",{...p,disabled:r||n,"aria-pressed":typeof i=="boolean"?i:p["aria-pressed"],onClick:r||n?void 0:a,className:j.classNames("inconel-button",`inconel-size-${w}`,B.BUTTON_TYPE_CLASS_NAMES[T],x&&"inconel-button--full-width",c!==null&&"inconel-button--has-progress",A&&"inconel-button--pill",n&&"inconel-is-loading",r&&"inconel-is-disabled",i&&"inconel-is-active",g),children:[c!==null&&e.jsx("span",{className:"inconel-button__progress",style:{width:`${c}%`,background:E??void 0}}),n&&e.jsx("span",{className:"inconel-button__spinner","aria-hidden":"true"}),!o&&h,_!==void 0&&e.jsx("span",{className:"inconel-button__title",children:_}),o&&h,f!=null&&e.jsx("span",{className:"inconel-button__count",children:f})]})}exports.Button=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),h=require("../shared/classNames.cjs");;/* empty css */const O=require("./constants.cjs");;/* empty css */const P=require("./utils.cjs"),R=require("../Svg/Svg.cjs");function Y({loading:n=!1,fullWidth:S=!1,variant:q="primary",label:v,buttonType:M,icon:s,iconClassName:k,iconWidth:l,iconHeight:o,iconRight:r=!1,render:w=!0,debounceTime:b,isActive:i,onClick:f,disabled:a,className:A,children:E,size:T="md",fixedHeight:g=!0,height:t,pill:B=!1,count:m,progress:p,progressColor:C,style:_,...N}){const I=M??q,$=!g&&t!==void 0?{..._,"--inconel-control-height":typeof t=="number"?`${t}px`:t}:_,c=j.useMemo(()=>P.createDebouncedCallback(f,b??0),[f,b]);if(j.useEffect(()=>()=>c.cancel(),[c]),!w)return null;const x=v??E,u=typeof p=="number"?Math.max(0,Math.min(100,p)):null,y=typeof s=="string"&&s?e.jsx("span",{className:h.classNames("inconel-button__icon",r?"inconel-button__icon--right":"inconel-button__icon--left",k),style:{width:l??void 0,height:o??void 0},"aria-hidden":"true",children:e.jsx(R.default,{src:s,renumerateIRIElements:!1,loading:()=>null,fallback:()=>null,beforeInjection:d=>{l&&d.setAttribute("width",String(l)),o&&d.setAttribute("height",String(o)),d.setAttribute("preserveAspectRatio","xMidYMid meet")}})}):null;return e.jsxs("button",{...N,style:$,disabled:a||n,"aria-pressed":typeof i=="boolean"?i:N["aria-pressed"],onClick:a||n?void 0:c,className:h.classNames("inconel-button",`inconel-size-${T}`,O.BUTTON_TYPE_CLASS_NAMES[I],S&&"inconel-button--full-width",u!==null&&"inconel-button--has-progress",B&&"inconel-button--pill",n&&"inconel-is-loading",a&&"inconel-is-disabled",i&&"inconel-is-active",A),children:[u!==null&&e.jsx("span",{className:"inconel-button__progress",style:{width:`${u}%`,background:C??void 0}}),n&&e.jsx("span",{className:"inconel-button__spinner","aria-hidden":"true"}),!r&&y,x!==void 0&&e.jsx("span",{className:"inconel-button__title",children:x}),r&&y,m!=null&&e.jsx("span",{className:"inconel-button__count",children:m})]})}exports.Button=Y;
2
2
  //# sourceMappingURL=Button.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.cjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type ButtonHTMLAttributes,\n type ReactNode,\n} from 'react'\n\nimport { classNames } from '../shared/classNames'\nimport '../shared/sizes.css'\nimport type { ControlSize } from '../shared/types'\nimport { Svg } from '../Svg'\nimport {\n BUTTON_TYPE_CLASS_NAMES,\n type ButtonType,\n} from './constants'\nimport './styles.css'\nimport { createDebouncedCallback } from './utils'\n\nexport interface ButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n label?: ReactNode\n buttonType?: ButtonType\n icon?: string | null\n iconClassName?: string\n iconWidth?: number | null\n iconHeight?: number | null\n iconRight?: boolean\n render?: boolean\n debounceTime?: number | null\n isActive?: boolean | null\n onChange?: ButtonHTMLAttributes<HTMLButtonElement>['onChange']\n loading?: boolean\n fullWidth?: boolean\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'warning' | 'dark'\n size?: ControlSize\n pill?: boolean\n count?: ReactNode\n progress?: number | null\n progressColor?: string | null\n}\n\nexport function Button({\n loading = false,\n fullWidth = false,\n variant = 'primary',\n label,\n buttonType,\n icon,\n iconClassName,\n iconWidth,\n iconHeight,\n iconRight = false,\n render = true,\n debounceTime,\n isActive,\n onClick,\n disabled,\n className,\n children,\n size = 'md',\n pill = false,\n count,\n progress,\n progressColor,\n ...props\n}: ButtonProps) {\n const resolvedType = buttonType ?? variant\n const debouncedClick = useMemo(\n () => createDebouncedCallback(onClick, debounceTime ?? 0),\n [onClick, debounceTime],\n )\n\n useEffect(() => () => debouncedClick.cancel(), [debouncedClick])\n\n if (!render) return null\n\n const content = label ?? children\n const progressWidth =\n typeof progress === 'number' ? Math.max(0, Math.min(100, progress)) : null\n const iconNode = typeof icon === 'string' && icon ? (\n <span\n className={classNames(\n 'inconel-button__icon',\n iconRight\n ? 'inconel-button__icon--right'\n : 'inconel-button__icon--left',\n iconClassName,\n )}\n style={{ width: iconWidth ?? undefined, height: iconHeight ?? undefined }}\n aria-hidden=\"true\"\n >\n <Svg\n src={icon}\n renumerateIRIElements={false}\n loading={() => null}\n fallback={() => null}\n beforeInjection={(svg) => {\n if (iconWidth) svg.setAttribute('width', String(iconWidth))\n if (iconHeight) svg.setAttribute('height', String(iconHeight))\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet')\n }}\n />\n </span>\n ) : null\n\n return (\n <button\n {...props}\n disabled={disabled || loading}\n aria-pressed={\n typeof isActive === 'boolean' ? isActive : props['aria-pressed']\n }\n onClick={disabled || loading ? undefined : debouncedClick}\n className={classNames(\n 'inconel-button',\n `inconel-size-${size}`,\n BUTTON_TYPE_CLASS_NAMES[resolvedType],\n fullWidth && 'inconel-button--full-width',\n progressWidth !== null && 'inconel-button--has-progress',\n pill && 'inconel-button--pill',\n loading && 'inconel-is-loading',\n disabled && 'inconel-is-disabled',\n isActive && 'inconel-is-active',\n className,\n )}\n >\n {progressWidth !== null && (\n <span\n className=\"inconel-button__progress\"\n style={{\n width: `${progressWidth}%`,\n background: progressColor ?? undefined,\n }}\n />\n )}\n {loading && <span className=\"inconel-button__spinner\" aria-hidden=\"true\" />}\n {!iconRight && iconNode}\n {content !== undefined && (\n <span className=\"inconel-button__title\">{content}</span>\n )}\n {iconRight && iconNode}\n {count != null && <span className=\"inconel-button__count\">{count}</span>}\n </button>\n )\n}\n"],"names":["Button","loading","fullWidth","variant","label","buttonType","icon","iconClassName","iconWidth","iconHeight","iconRight","render","debounceTime","isActive","onClick","disabled","className","children","size","pill","count","progress","progressColor","props","resolvedType","debouncedClick","useMemo","createDebouncedCallback","useEffect","content","progress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D,CAAA,CAAA,CACF,CAAA,EAEA,KAEJ,OACEC,EAAAA,KAAC,SAAA,CACE,GAAGb,EACJ,SAAUR,GAAYd,EACtB,eACE,OAAOY,GAAa,UAAYA,EAAWU,EAAM,cAAc,EAEjE,QAASR,GAAYd,EAAU,OAAYwB,EAC3C,UAAWQ,EAAAA,WACT,iBACA,gBAAgBf,CAAI,GACpBmB,EAAAA,wBAAwBb,CAAY,EACpCtB,GAAa,6BACb4B,IAAkB,MAAQ,+BAC1BX,GAAQ,uBACRlB,GAAW,qBACXc,GAAY,sBACZF,GAAY,oBACZG,CAAA,EAGD,SAAA,CAAAc,IAAkB,MACjBE,EAAAA,IAAC,OAAA,CACC,UAAU,2BACV,MAAO,CACL,MAAO,GAAGF,CAAa,IACvB,WAAYR,GAAiB,MAAA,CAC/B,CAAA,EAGHrB,GAAW+B,EAAAA,IAAC,OAAA,CAAK,UAAU,0BAA0B,cAAY,OAAO,EACxE,CAACtB,GAAaqB,EACdF,IAAY,QACXG,EAAAA,IAAC,OAAA,CAAK,UAAU,wBAAyB,SAAAH,EAAQ,EAElDnB,GAAaqB,EACbX,GAAS,MAAQY,EAAAA,IAAC,OAAA,CAAK,UAAU,wBAAyB,SAAAZ,CAAA,CAAM,CAAA,CAAA,CAAA,CAGvE"}
1
+ {"version":3,"file":"Button.cjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type ButtonHTMLAttributes,\n type ReactNode,\n} from 'react'\n\nimport { classNames } from '../shared/classNames'\nimport '../shared/sizes.css'\nimport type { ControlSize } from '../shared/types'\nimport { Svg } from '../Svg'\nimport {\n BUTTON_TYPE_CLASS_NAMES,\n type ButtonType,\n} from './constants'\nimport './styles.css'\nimport { createDebouncedCallback } from './utils'\n\nexport interface ButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n label?: ReactNode\n buttonType?: ButtonType\n icon?: string | null\n iconClassName?: string\n iconWidth?: number | null\n iconHeight?: number | null\n iconRight?: boolean\n render?: boolean\n debounceTime?: number | null\n isActive?: boolean | null\n onChange?: ButtonHTMLAttributes<HTMLButtonElement>['onChange']\n loading?: boolean\n fullWidth?: boolean\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'warning' | 'dark'\n size?: ControlSize\n fixedHeight?: boolean\n height?: number | string\n pill?: boolean\n count?: ReactNode\n progress?: number | null\n progressColor?: string | null\n}\n\nexport function Button({\n loading = false,\n fullWidth = false,\n variant = 'primary',\n label,\n buttonType,\n icon,\n iconClassName,\n iconWidth,\n iconHeight,\n iconRight = false,\n render = true,\n debounceTime,\n isActive,\n onClick,\n disabled,\n className,\n children,\n size = 'md',\n fixedHeight = true,\n height,\n pill = false,\n count,\n progress,\n progressColor,\n style,\n ...props\n}: ButtonProps) {\n const resolvedType = buttonType ?? variant\n const resolvedStyle = !fixedHeight && height !== undefined\n ? { ...style, '--inconel-control-height': typeof height === 'number' ? `${height}px` : height } as typeof style\n : style\n const debouncedClick = useMemo(\n () => createDebouncedCallback(onClick, debounceTime ?? 0),\n [onClick, debounceTime],\n )\n\n useEffect(() => () => debouncedClick.cancel(), [debouncedClick])\n\n if (!render) return null\n\n const content = label ?? children\n const progressWidth =\n typeof progress === 'number' ? Math.max(0, Math.min(100, progress)) : null\n const iconNode = typeof icon === 'string' && icon ? (\n <span\n className={classNames(\n 'inconel-button__icon',\n iconRight\n ? 'inconel-button__icon--right'\n : 'inconel-button__icon--left',\n iconClassName,\n )}\n style={{ width: iconWidth ?? undefined, height: iconHeight ?? undefined }}\n aria-hidden=\"true\"\n >\n <Svg\n src={icon}\n renumerateIRIElements={false}\n loading={() => null}\n fallback={() => null}\n beforeInjection={(svg) => {\n if (iconWidth) svg.setAttribute('width', String(iconWidth))\n if (iconHeight) svg.setAttribute('height', String(iconHeight))\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet')\n }}\n />\n </span>\n ) : null\n\n return (\n <button\n {...props}\n style={resolvedStyle}\n disabled={disabled || loading}\n aria-pressed={\n typeof isActive === 'boolean' ? isActive : props['aria-pressed']\n }\n onClick={disabled || loading ? undefined : debouncedClick}\n className={classNames(\n 'inconel-button',\n `inconel-size-${size}`,\n BUTTON_TYPE_CLASS_NAMES[resolvedType],\n fullWidth && 'inconel-button--full-width',\n progressWidth !== null && 'inconel-button--has-progress',\n pill && 'inconel-button--pill',\n loading && 'inconel-is-loading',\n disabled && 'inconel-is-disabled',\n isActive && 'inconel-is-active',\n className,\n )}\n >\n {progressWidth !== null && (\n <span\n className=\"inconel-button__progress\"\n style={{\n width: `${progressWidth}%`,\n background: progressColor ?? undefined,\n }}\n />\n )}\n {loading && <span className=\"inconel-button__spinner\" aria-hidden=\"true\" />}\n {!iconRight && iconNode}\n {content !== undefined && (\n <span className=\"inconel-button__title\">{content}</span>\n )}\n {iconRight && iconNode}\n {count != null && <span className=\"inconel-button__count\">{count}</span>}\n </button>\n )\n}\n"],"names":["Button","loading","fullWidth","variant","label","buttonType","icon","iconClassName","iconWidth","iconHeight","iconRight","render","debounceTime","isActive","onClick","disabled","className","children","size","fixedHeight","height","pill","count","progress","progressColor","style","props","resolvedType","resolvedStyle","debouncedClick","useMemo","createDebouncedCallback","useEffect","content","progressWidth","iconNode","jsx","classNames","Svg","svg","jsxs","BUTTON_TYPE_CLASS_NAMES"],"mappings":"2UA2CO,SAASA,EAAO,CACrB,QAAAC,EAAU,GACV,UAAAC,EAAY,GACZ,QAAAC,EAAU,UACV,MAAAC,EACA,WAAAC,EACA,KAAAC,EACA,cAAAC,EACA,UAAAC,EACA,WAAAC,EACA,UAAAC,EAAY,GACZ,OAAAC,EAAS,GACT,aAAAC,EACA,SAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,KACP,YAAAC,EAAc,GACd,OAAAC,EACA,KAAAC,EAAO,GACP,MAAAC,EACA,SAAAC,EACA,cAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EAAgB,CACd,MAAMC,E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Bb,GAAQ,uBACRpB,GAAW,qBACXc,GAAY,sBACZF,GAAY,oBACZG,CAAA,EAGD,SAAA,CAAAkB,IAAkB,MACjBE,EAAAA,IAAC,OAAA,CACC,UAAU,2BACV,MAAO,CACL,MAAO,GAAGF,CAAa,IACvB,WAAYV,GAAiB,MAAA,CAC/B,CAAA,EAGHvB,GAAWmC,EAAAA,IAAC,OAAA,CAAK,UAAU,0BAA0B,cAAY,OAAO,EACxE,CAAC1B,GAAayB,EACdF,IAAY,QACXG,EAAAA,IAAC,OAAA,CAAK,UAAU,wBAAyB,SAAAH,EAAQ,EAElDvB,GAAayB,EACbb,GAAS,MAAQc,EAAAA,IAAC,OAAA,CAAK,UAAU,wBAAyB,SAAAd,CAAA,CAAM,CAAA,CAAA,CAAA,CAGvE"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),u=require("react"),ve=require("../FieldFeedback/FieldFeedback.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */const i=require("./utils.cjs"),Ve=u.forwardRef(function({id:J,label:d,hint:E,errorMessage:O,startAdornment:R,endAdornment:w,fullWidth:S=!1,inputClassName:Q,labelClassName:x,className:y,required:b,disabled:h,value:B,defaultValue:U="",onChange:v,onBlur:X,onFocus:Z,onKeyDown:W,onMouseEnter:A,onMouseLeave:ee,type:n="text",locale:f="tr-TR",currency:V="TRY",decimalScale:j=0,roundMode:ne="floor",roundOnBlur:re=!1,min:T,max:N,allowNegative:$=!1,debounceMs:D=0,validateOnSubmit:z=!1,validationMessages:ie,mask:s,limit:m,isClearable:oe=!1,readOnly:te=!1,clearButtonLabel:L,readOnlyEmptyValue:le=null,size:P="md",variant:ue="outlined",autoComplete:se="off","aria-describedby":ae,...ce},de){const fe=u.useId(),I=J??`inconel-input-${fe.replace(/:/g,"")}`,C=`${I}-hint`,K=`${I}-error`,Y=B!==void 0,[pe,he]=u.useState(U),t=Y?B:pe,[k,F]=u.useState(""),[je,G]=u.useState(!1),[me,M]=u.useState(null),a=u.useRef(null),Ie=ie??{},p=O??me,g=e=>i.validateInputValue(e,{required:!!b,type:n,min:T,max:N,mask:s,messages:Ie}),q=u.useMemo(()=>i.formatInputValue(t,n,f,j,V,s),[t,V,j,f,s,n]),c=(e,r,l=null)=>({rawValue:e,formattedValue:i.formatInputValue(e,n,f,j,V,s),error:!!g(e),char:l,eventType:r}),_=(e,r=!1)=>{Y||he(e.rawValue),a.current&&clearTimeout(a.current),v&&(r||D<=0?v(e):a.current=setTimeout(()=>v(e),D))};u.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),u.useEffect(()=>{z&&M(g(t))},[z]);const H=e=>{if(n==="phone"&&s)return e.replace(/\D/g,"");if(i.isFormattedInputType(n)){const r=i.parseInputNumber(e,f);return r===null?e===""?null:e:$?r:Math.abs(r)}return e},ge=e=>{const r=e.replace(/\D/g,"");if(m&&(i.isFormattedInputType(n)||n==="phone")&&r.length>m||m&&i.isLengthValidatedInputType(n)&&e.length>m)return;const l=H(e);typeof l=="number"&&(typeof T=="number"&&l<T||typeof N=="number"&&l>N)||(F(n==="phone"&&s?i.applyInputMask(l,s):e),_(c(l,"change",e.slice(-1)||null)))},be=[ae,E&&!p?C:void 0,p?K:void 0].filter(Boolean).join(" ")||void 0;return te?o.jsxs("div",{className:["inconel-field",`inconel-size-${P}`,S?"inconel-field--full-width":"",y??""].join(" "),children:[d&&o.jsx("span",{className:["inconel-field__label",x??""].join(" "),children:d}),o.jsx("div",{className:"inconel-input-readonly","aria-label":d,children:q||le})]}):o.jsxs("div",{className:["inconel-field",`inconel-size-${P}`,S?"inconel-field--full-width":"",y??""].join(" "),children:[d&&o.jsxs("label",{className:["inconel-field__label",x??""].join(" "),htmlFor:I,children:[d,b&&o.jsx("span",{className:"inconel-field__required","aria-hidden":"true",children:" *"})]}),o.jsxs("div",{className:["inconel-input-control",ue==="plain"?"inconel-input-control--plain":"",p?"inconel-is-invalid":"",h?"inconel-is-disabled":""].join(" "),children:[R&&o.jsx("span",{className:"inconel-input-adornment","aria-hidden":"true",children:R}),o.jsx("input",{...ce,ref:de,id:I,type:n==="password"||n==="email"?n:"text",inputMode:i.isFormattedInputType(n)?"decimal":n==="phone"?"tel":void 0,value:je?k:q,required:b,disabled:h,autoComplete:se,"aria-invalid":!!p,"aria-describedby":be,className:["inconel-input",Q??""].join(" "),onChange:e=>ge(e.target.value),onFocus:e=>{if(h)return;G(!0);const r=n==="phone"&&s?i.applyInputMask(t,s):i.isFormattedInputType(n)?String(t??"").replace(".",i.getInputSeparators(f).decimal):String(t??"");F(r),Z?.(c(t,"focus"),e)},onBlur:e=>{G(!1),a.current&&clearTimeout(a.current);let r=H(k);typeof r=="number"&&(r=i.roundInputNumber(r,j,re?ne:"floor")),M(g(r));const l=c(r,"blur");_(l,!0),X?.(l,e)},onKeyDown:e=>{!$&&(e.key==="-"||e.key==="Subtract")&&e.preventDefault(),W?.(c(t,"keydown",e.key),e)},onMouseEnter:e=>A?.(c(t,"mouseenter"),e),onMouseLeave:e=>ee?.(c(t,"mouseleave"),e)}),oe&&!h&&q&&L&&o.jsx("button",{type:"button",className:"inconel-input-clear","aria-label":L,onClick:()=>{F(""),M(g(null)),_(c(null,"clear"),!0)},children:"×"}),w&&o.jsx("span",{className:"inconel-input-adornment","aria-hidden":"true",children:w})]}),o.jsx(ve.default,{hint:E,errorMessage:p,hintId:C,errorId:K})]})});exports.default=Ve;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),u=require("react"),Ve=require("../FieldFeedback/FieldFeedback.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */const i=require("./utils.cjs"),Ne=require("../../adapters/context.cjs"),qe=u.forwardRef(function({id:H,label:d,hint:B,errorMessage:J,startAdornment:E,endAdornment:R,fullWidth:S=!1,inputClassName:O,labelClassName:w,className:x,required:b,disabled:h,value:y,defaultValue:Q="",onChange:v,onBlur:U,onFocus:X,onKeyDown:Z,onMouseEnter:A,onMouseLeave:W,type:n="text",locale:f="tr-TR",currency:T="TRY",decimalScale:m=0,roundMode:ee="floor",roundOnBlur:ne=!1,min:V,max:N,allowNegative:$=!1,debounceMs:z=0,validateOnSubmit:D=!1,validationMessages:re,mask:s,limit:j,isClearable:ie=!1,readOnly:te=!1,clearButtonLabel:oe,readOnlyEmptyValue:le=null,size:L="md",variant:ue="outlined",autoComplete:se="off","aria-describedby":ae,...ce},de){const fe=Ne.useInconelAdapters(),pe=oe??String(fe.translate?.("clear","Temizle")??"Temizle"),he=u.useId(),I=H??`inconel-input-${he.replace(/:/g,"")}`,C=`${I}-hint`,P=`${I}-error`,K=y!==void 0,[me,je]=u.useState(Q),o=K?y:me,[Y,q]=u.useState(""),[Ie,k]=u.useState(!1),[ge,F]=u.useState(null),a=u.useRef(null),be=re??{},p=J??ge,g=e=>i.validateInputValue(e,{required:!!b,type:n,min:V,max:N,mask:s,messages:be}),M=u.useMemo(()=>i.formatInputValue(o,n,f,m,T,s),[o,T,m,f,s,n]),c=(e,r,l=null)=>({rawValue:e,formattedValue:i.formatInputValue(e,n,f,m,T,s),error:!!g(e),char:l,eventType:r}),_=(e,r=!1)=>{K||je(e.rawValue),a.current&&clearTimeout(a.current),v&&(r||z<=0?v(e):a.current=setTimeout(()=>v(e),z))};u.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),u.useEffect(()=>{D&&F(g(o))},[D]);const G=e=>{if(n==="phone"&&s)return e.replace(/\D/g,"");if(i.isFormattedInputType(n)){const r=i.parseInputNumber(e,f);return r===null?e===""?null:e:$?r:Math.abs(r)}return e},ve=e=>{const r=e.replace(/\D/g,"");if(j&&(i.isFormattedInputType(n)||n==="phone")&&r.length>j||j&&i.isLengthValidatedInputType(n)&&e.length>j)return;const l=G(e);typeof l=="number"&&(typeof V=="number"&&l<V||typeof N=="number"&&l>N)||(q(n==="phone"&&s?i.applyInputMask(l,s):e),_(c(l,"change",e.slice(-1)||null)))},Te=[ae,B&&!p?C:void 0,p?P:void 0].filter(Boolean).join(" ")||void 0;return te?t.jsxs("div",{className:["inconel-field",`inconel-size-${L}`,S?"inconel-field--full-width":"",x??""].join(" "),children:[d&&t.jsx("span",{className:["inconel-field__label",w??""].join(" "),children:d}),t.jsx("div",{className:"inconel-input-readonly","aria-label":d,children:M||le})]}):t.jsxs("div",{className:["inconel-field",`inconel-size-${L}`,S?"inconel-field--full-width":"",x??""].join(" "),children:[d&&t.jsxs("label",{className:["inconel-field__label",w??""].join(" "),htmlFor:I,children:[d,b&&t.jsx("span",{className:"inconel-field__required","aria-hidden":"true",children:" *"})]}),t.jsxs("div",{className:["inconel-input-control",ue==="plain"?"inconel-input-control--plain":"",p?"inconel-is-invalid":"",h?"inconel-is-disabled":""].join(" "),children:[E&&t.jsx("span",{className:"inconel-input-adornment","aria-hidden":"true",children:E}),t.jsx("input",{...ce,ref:de,id:I,type:n==="password"||n==="email"?n:"text",inputMode:i.isFormattedInputType(n)?"decimal":n==="phone"?"tel":void 0,value:Ie?Y:M,required:b,disabled:h,autoComplete:se,"aria-invalid":!!p,"aria-describedby":Te,className:["inconel-input",O??""].join(" "),onChange:e=>ve(e.target.value),onFocus:e=>{if(h)return;k(!0);const r=n==="phone"&&s?i.applyInputMask(o,s):i.isFormattedInputType(n)?String(o??"").replace(".",i.getInputSeparators(f).decimal):String(o??"");q(r),X?.(c(o,"focus"),e)},onBlur:e=>{k(!1),a.current&&clearTimeout(a.current);let r=G(Y);typeof r=="number"&&(r=i.roundInputNumber(r,m,ne?ee:"floor")),F(g(r));const l=c(r,"blur");_(l,!0),U?.(l,e)},onKeyDown:e=>{!$&&(e.key==="-"||e.key==="Subtract")&&e.preventDefault(),Z?.(c(o,"keydown",e.key),e)},onMouseEnter:e=>A?.(c(o,"mouseenter"),e),onMouseLeave:e=>W?.(c(o,"mouseleave"),e)}),ie&&!h&&M&&t.jsx("button",{type:"button",className:"inconel-input-clear","aria-label":pe,onClick:()=>{q(""),F(g(null)),_(c(null,"clear"),!0)},children:"×"}),R&&t.jsx("span",{className:"inconel-input-adornment","aria-hidden":"true",children:R})]}),t.jsx(Ve.default,{hint:B,errorMessage:p,hintId:C,errorId:P})]})});exports.default=qe;
2
2
  //# sourceMappingURL=Input.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.cjs","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type FocusEvent,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\n\nimport FieldFeedback from '../FieldFeedback/FieldFeedback'\nimport type { FieldFeedbackContentProps } from '../FieldFeedback/FieldFeedback'\nimport '../shared/field.css'\nimport '../shared/field-controls.css'\nimport '../shared/sizes.css'\nimport type { ControlSize } from '../shared/types'\nimport './styles.css'\nimport {\n applyInputMask,\n formatInputValue,\n getInputSeparators,\n isFormattedInputType,\n isLengthValidatedInputType,\n parseInputNumber,\n roundInputNumber,\n validateInputValue,\n} from './utils'\n\nexport type InputType =\n | 'text'\n | 'number'\n | 'currency'\n | 'percent'\n | 'phone'\n | 'email'\n | 'password'\n\nexport type InputRoundMode = 'ceil' | 'floor' | 'round'\nexport type InputValue = string | number | null\nexport type InputEventType =\n | 'change'\n | 'blur'\n | 'focus'\n | 'keydown'\n | 'mouseenter'\n | 'mouseleave'\n | 'clear'\n\nexport interface InputPayload {\n rawValue: InputValue\n formattedValue: string\n error: boolean\n char: string | null\n eventType: InputEventType\n}\n\nexport interface InputValidationMessages {\n required?: string\n invalidNumber?: string\n minNumber?: string\n maxNumber?: string\n minLength?: string\n maxLength?: string\n invalidPhone?: string\n invalidEmail?: string\n}\n\ntype NativeInputProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n | 'type'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'onBlur'\n | 'onFocus'\n | 'onKeyDown'\n | 'onMouseEnter'\n | 'onMouseLeave'\n | 'min'\n | 'max'\n | 'size'\n | 'readOnly'\n>\n\nexport interface InputProps extends NativeInputProps, FieldFeedbackContentProps {\n label?: string\n startAdornment?: ReactNode\n endAdornment?: ReactNode\n fullWidth?: boolean\n inputClassName?: string\n labelClassName?: string\n value?: InputValue\n defaultValue?: InputValue\n onChange?: (payload: InputPayload) => void\n onBlur?: (payload: InputPayload, event: FocusEvent<HTMLInputElement>) => void\n onFocus?: (payload: InputPayload, event: FocusEvent<HTMLInputElement>) => void\n onKeyDown?: (\n payload: InputPayload,\n event: KeyboardEvent<HTMLInputElement>,\n ) => void\n onMouseEnter?: (\n payload: InputPayload,\n event: MouseEvent<HTMLInputElement>,\n ) => void\n onMouseLeave?: (\n payload: InputPayload,\n event: MouseEvent<HTMLInputElement>,\n ) => void\n type?: InputType\n locale?: string\n currency?: string\n decimalScale?: number\n roundMode?: InputRoundMode\n roundOnBlur?: boolean\n min?: number\n max?: number\n allowNegative?: boolean\n debounceMs?: number\n validateOnSubmit?: boolean\n validationMessages?: InputValidationMessages\n mask?: string\n limit?: number\n isClearable?: boolean\n readOnly?: boolean\n clearButtonLabel?: string\n readOnlyEmptyValue?: ReactNode\n size?: ControlSize\n variant?: 'outlined' | 'plain'\n}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n id,\n label,\n hint,\n errorMessage,\n startAdornment,\n endAdornment,\n fullWidth = false,\n inputClassName,\n labelClassName,\n className,\n required,\n disabled,\n value,\n defaultValue = '',\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onMouseEnter,\n onMouseLeave,\n type = 'text',\n locale = 'tr-TR',\n currency = 'TRY',\n decimalScale = 0,\n roundMode = 'floor',\n roundOnBlur = false,\n min,\n max,\n allowNegative = false,\n debounceMs = 0,\n validateOnSubmit = false,\n validationMessages,\n mask,\n limit,\n isClearable = false,\n readOnly = false,\n clearButtonLabel,\n readOnlyEmptyValue = null,\n size = 'md',\n variant = 'outlined',\n autoComplete = 'off',\n 'aria-describedby': ariaDescribedBy,\n ...inputProps\n },\n ref,\n) {\n const generatedId = useId()\n const inputId = id ?? `inconel-input-${generatedId.replace(/:/g, '')}`\n const hintId = `${inputId}-hint`\n const errorId = `${inputId}-error`\n const controlled = value !== undefined\n const [localValue, setLocalValue] = useState<InputValue>(defaultValue)\n const currentValue = controlled ? value : localValue\n const [editingValue, setEditingValue] = useState('')\n const [focused, setFocused] = useState(false)\n const [validationError, setValidationError] = useState<string | null>(null)\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const messages = validationMessages ?? {}\n const visibleError = errorMessage ?? validationError\n\n const validate = (candidate: InputValue) =>\n validateInputValue(candidate, {\n required: Boolean(required),\n type,\n min,\n max,\n mask,\n messages,\n })\n\n const formattedValue = useMemo(\n () =>\n formatInputValue(\n currentValue,\n type,\n locale,\n decimalScale,\n currency,\n mask,\n ),\n [currentValue, currency, decimalScale, locale, mask, type],\n )\n\n const buildPayload = (\n rawValue: InputValue,\n eventType: InputEventType,\n char: string | null = null,\n ): InputPayload => ({\n rawValue,\n formattedValue: formatInputValue(\n rawValue,\n type,\n locale,\n decimalScale,\n currency,\n mask,\n ),\n error: Boolean(validate(rawValue)),\n char,\n eventType,\n })\n\n const emitChange = (payload: InputPayload, immediate = false) => {\n if (!controlled) setLocalValue(payload.rawValue)\n if (debounceRef.current) clearTimeout(debounceRef.current)\n if (!onChange) return\n if (immediate || debounceMs <= 0) onChange(payload)\n else debounceRef.current = setTimeout(() => onChange(payload), debounceMs)\n }\n\n useEffect(() => () => {\n if (debounceRef.current) clearTimeout(debounceRef.current)\n }, [])\n\n useEffect(() => {\n if (validateOnSubmit) setValidationError(validate(currentValue))\n // Validation intentionally runs when submit state changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [validateOnSubmit])\n\n const normalize = (text: string): InputValue => {\n if (type === 'phone' && mask) return text.replace(/\\D/g, '')\n if (isFormattedInputType(type)) {\n const parsed = parseInputNumber(text, locale)\n if (parsed === null) return text === '' ? null : text\n return allowNegative ? parsed : Math.abs(parsed)\n }\n return text\n }\n\n const handleChange = (text: string) => {\n const digits = text.replace(/\\D/g, '')\n if (\n limit &&\n (isFormattedInputType(type) || type === 'phone') &&\n digits.length > limit\n ) return\n if (limit && isLengthValidatedInputType(type) && text.length > limit) return\n const rawValue = normalize(text)\n if (typeof rawValue === 'number') {\n if (typeof min === 'number' && rawValue < min) return\n if (typeof max === 'number' && rawValue > max) return\n }\n setEditingValue(\n type === 'phone' && mask ? applyInputMask(rawValue, mask) : text,\n )\n emitChange(buildPayload(rawValue, 'change', text.slice(-1) || null))\n }\n\n const describedBy = [\n ariaDescribedBy,\n hint && !visibleError ? hintId : undefined,\n visibleError ? errorId : undefined,\n ].filter(Boolean).join(' ') || undefined\n\n if (readOnly) {\n return (\n <div className={['inconel-field', `inconel-size-${size}`, fullWidth ? 'inconel-field--full-width' : '', className ?? ''].join(' ')}>\n {label && <span className={['inconel-field__label', labelClassName ?? ''].join(' ')}>{label}</span>}\n <div className=\"inconel-input-readonly\" aria-label={label}>\n {formattedValue || readOnlyEmptyValue}\n </div>\n </div>\n )\n }\n\n return (\n <div className={['inconel-field', `inconel-size-${size}`, fullWidth ? 'inconel-field--full-width' : '', className ?? ''].join(' ')}>\n {label && (\n <label className={['inconel-field__label', labelClassName ?? ''].join(' ')} htmlFor={inputId}>\n {label}{required && <span className=\"inconel-field__required\" aria-hidden=\"true\"> *</span>}\n </label>\n )}\n <div className={['inconel-input-control', variant === 'plain' ? 'inconel-input-control--plain' : '', visibleError ? 'inconel-is-invalid' : '', disabled ? 'inconel-is-disabled' : ''].join(' ')}>\n {startAdornment && <span className=\"inconel-input-adornment\" aria-hidden=\"true\">{startAdornment}</span>}\n <input\n {...inputProps}\n ref={ref}\n id={inputId}\n type={type === 'password' || type === 'email' ? type : 'text'}\n inputMode={isFormattedInputType(type) ? 'decimal' : type === 'phone' ? 'tel' : undefined}\n value={focused ? editingValue : formattedValue}\n required={required}\n disabled={disabled}\n autoComplete={autoComplete}\n aria-invalid={Boolean(visibleError)}\n aria-describedby={describedBy}\n className={['inconel-input', inputClassName ?? ''].join(' ')}\n onChange={(event) => handleChange(event.target.value)}\n onFocus={(event) => {\n if (disabled) return\n setFocused(true)\n const editValue = type === 'phone' && mask\n ? applyInputMask(currentValue, mask)\n : isFormattedInputType(type)\n ? String(currentValue ?? '').replace('.', getInputSeparators(locale).decimal)\n : String(currentValue ?? '')\n setEditingValue(editValue)\n onFocus?.(buildPayload(currentValue, 'focus'), event)\n }}\n onBlur={(event) => {\n setFocused(false)\n if (debounceRef.current) clearTimeout(debounceRef.current)\n let rawValue = normalize(editingValue)\n if (typeof rawValue === 'number') {\n rawValue = roundInputNumber(rawValue, decimalScale, roundOnBlur ? roundMode : 'floor')\n }\n setValidationError(validate(rawValue))\n const payload = buildPayload(rawValue, 'blur')\n emitChange(payload, true)\n onBlur?.(payload, event)\n }}\n onKeyDown={(event) => {\n if (!allowNegative && (event.key === '-' || event.key === 'Subtract')) event.preventDefault()\n onKeyDown?.(buildPayload(currentValue, 'keydown', event.key), event)\n }}\n onMouseEnter={(event) => onMouseEnter?.(buildPayload(currentValue, 'mouseenter'), event)}\n onMouseLeave={(event) => onMouseLeave?.(buildPayload(currentValue, 'mouseleave'), event)}\n />\n {isClearable && !disabled && formattedValue && clearButtonLabel && (\n <button\n type=\"button\"\n className=\"inconel-input-clear\"\n aria-label={clearButtonLabel}\n onClick={() => {\n setEditingValue('')\n setValidationError(validate(null))\n emitChange(buildPayload(null, 'clear'), true)\n }}\n >\n ×\n </button>\n )}\n {endAdornment && <span className=\"inconel-input-adornment\" aria-hidden=\"true\">{endAdornment}</span>}\n </div>\n <FieldFeedback\n hint={hint}\n errorMessage={visibleError}\n hintId={hintId}\n errorId={errorId}\n />\n </div>\n )\n})\n\nexport default Input\n"],"names":["Input","forwardRef","id","label","hint","errorMessage","startAdornment","endAdornment","fullWidth","inputClassName","labelClassName","className","required","disabled","value","defaultValue","onChange","onBlur","onFocus","onKeyDown","onMouseEnter","onMouseLeave","type","locale","currency","decimalScale","roundMode","roundOnBlur","min","max","allowNegative","debounceMs","validateOnSubmit","validationMessages","mask","limit","isClearable","readOnly","clearButtonLabel","readOnlyEmptyValue","size","variant","autoComplete","ariaDescribedBy","inputProps","ref","generatedId","useId","inputId","hintId","errorId","controlled","localValue","setLocalValue","useState","currentValue","editingValue","setEditingValue","focused","setFocused","validationError","setValidationError","debounceRef","useRef","messages","visibleError","validate","candidate","validateInputValue","formattedValue","useMemo","formatInputValue","buildPayload","rawValue","eventType","char","emitChange","payload","immediate","useEffect","normalize","text","isFormattedInputType","parsed","parseInputNumber","handleChange","digits","isLengthValidatedInputType","applyInputMask","describedBy","jsx","jsxs","event","editValue","getInputSeparators","roundInputNumber","FieldFeedback"],"mappings":"kYAsIMA,GAAQC,EAAAA,WAAyC,SACrD,CACE,GAAAC,EACA,MAAAC,EACA,KAAAC,EACA,aAAAC,EACA,eAAAC,EACA,aAAAC,EACA,UAAAC,EAAY,GACZ,eAAAC,EACA,eAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EACA,MAAAC,EACA,aAAAC,EAAe,GACf,SAAAC,EACA,OAAAC,EACA,QAAAC,EACA,UAAAC,EACA,aAAAC,EACA,aAAAC,GACA,KAAAC,EAAO,OACP,OAAAC,EAAS,QACT,SAAAC,EAAW,MACX,aAAAC,EAAe,EACf,UAAAC,GAAY,QACZ,YAAAC,GAAc,GACd,IAAAC,EACA,IAAAC,EACA,cAAAC,EAAgB,GAChB,WAAAC,EAAa,EACb,iBAAAC,EAAmB,GACnB,mBAAAC,GACA,KAAAC,EACA,MAAAC,EACA,YAAAC,GAAc,GACd,SAAAC,GAAW,GACX,iBAAAC,EACA,mBAAAC,GAAqB,KACrB,KAAAC,EAAO,KACP,QAAAC,GAAU,WACV,aAAAC,GAAe,MACf,mBAAoBC,GACpB,GAAGC,EACL,EACAC,GACA,CACA,MAAMC,GAAcC,EAAAA,MAAA,EACdC,EAAU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cAAY,OAAQ,SAAAnF,CAAA,CAAa,CAAA,EAC9F,EACAmF,EAAAA,IAACM,GAAAA,QAAA,CACC,KAAA5F,EACA,aAAc6D,EACd,OAAAhB,EACA,QAAAC,CAAA,CAAA,CACF,EACF,CAEJ,CAAC"}
1
+ {"version":3,"file":"Input.cjs","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type FocusEvent,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\n\nimport { useInconelAdapters } from '../../adapters'\nimport FieldFeedback from '../FieldFeedback/FieldFeedback'\nimport type { FieldFeedbackContentProps } from '../FieldFeedback/FieldFeedback'\nimport '../shared/field.css'\nimport '../shared/field-controls.css'\nimport '../shared/sizes.css'\nimport type { ControlSize } from '../shared/types'\nimport './styles.css'\nimport {\n applyInputMask,\n formatInputValue,\n getInputSeparators,\n isFormattedInputType,\n isLengthValidatedInputType,\n parseInputNumber,\n roundInputNumber,\n validateInputValue,\n} from './utils'\n\nexport type InputType =\n | 'text'\n | 'number'\n | 'currency'\n | 'percent'\n | 'phone'\n | 'email'\n | 'password'\n\nexport type InputRoundMode = 'ceil' | 'floor' | 'round'\nexport type InputValue = string | number | null\nexport type InputEventType =\n | 'change'\n | 'blur'\n | 'focus'\n | 'keydown'\n | 'mouseenter'\n | 'mouseleave'\n | 'clear'\n\nexport interface InputPayload {\n rawValue: InputValue\n formattedValue: string\n error: boolean\n char: string | null\n eventType: InputEventType\n}\n\nexport interface InputValidationMessages {\n required?: string\n invalidNumber?: string\n minNumber?: string\n maxNumber?: string\n minLength?: string\n maxLength?: string\n invalidPhone?: string\n invalidEmail?: string\n}\n\ntype NativeInputProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n | 'type'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'onBlur'\n | 'onFocus'\n | 'onKeyDown'\n | 'onMouseEnter'\n | 'onMouseLeave'\n | 'min'\n | 'max'\n | 'size'\n | 'readOnly'\n>\n\nexport interface InputProps extends NativeInputProps, FieldFeedbackContentProps {\n label?: string\n startAdornment?: ReactNode\n endAdornment?: ReactNode\n fullWidth?: boolean\n inputClassName?: string\n labelClassName?: string\n value?: InputValue\n defaultValue?: InputValue\n onChange?: (payload: InputPayload) => void\n onBlur?: (payload: InputPayload, event: FocusEvent<HTMLInputElement>) => void\n onFocus?: (payload: InputPayload, event: FocusEvent<HTMLInputElement>) => void\n onKeyDown?: (\n payload: InputPayload,\n event: KeyboardEvent<HTMLInputElement>,\n ) => void\n onMouseEnter?: (\n payload: InputPayload,\n event: MouseEvent<HTMLInputElement>,\n ) => void\n onMouseLeave?: (\n payload: InputPayload,\n event: MouseEvent<HTMLInputElement>,\n ) => void\n type?: InputType\n locale?: string\n currency?: string\n decimalScale?: number\n roundMode?: InputRoundMode\n roundOnBlur?: boolean\n min?: number\n max?: number\n allowNegative?: boolean\n debounceMs?: number\n validateOnSubmit?: boolean\n validationMessages?: InputValidationMessages\n mask?: string\n limit?: number\n isClearable?: boolean\n readOnly?: boolean\n clearButtonLabel?: string\n readOnlyEmptyValue?: ReactNode\n size?: ControlSize\n variant?: 'outlined' | 'plain'\n}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n id,\n label,\n hint,\n errorMessage,\n startAdornment,\n endAdornment,\n fullWidth = false,\n inputClassName,\n labelClassName,\n className,\n required,\n disabled,\n value,\n defaultValue = '',\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onMouseEnter,\n onMouseLeave,\n type = 'text',\n locale = 'tr-TR',\n currency = 'TRY',\n decimalScale = 0,\n roundMode = 'floor',\n roundOnBlur = false,\n min,\n max,\n allowNegative = false,\n debounceMs = 0,\n validateOnSubmit = false,\n validationMessages,\n mask,\n limit,\n isClearable = false,\n readOnly = false,\n clearButtonLabel,\n readOnlyEmptyValue = null,\n size = 'md',\n variant = 'outlined',\n autoComplete = 'off',\n 'aria-describedby': ariaDescribedBy,\n ...inputProps\n },\n ref,\n) {\n const adapters = useInconelAdapters()\n const resolvedClearButtonLabel =\n clearButtonLabel ??\n String(adapters.translate?.('clear', 'Temizle') ?? 'Temizle')\n\n const generatedId = useId()\n const inputId = id ?? `inconel-input-${generatedId.replace(/:/g, '')}`\n const hintId = `${inputId}-hint`\n const errorId = `${inputId}-error`\n const controlled = value !== undefined\n const [localValue, setLocalValue] = useState<InputValue>(defaultValue)\n const currentValue = controlled ? value : localValue\n const [editingValue, setEditingValue] = useState('')\n const [focused, setFocused] = useState(false)\n const [validationError, setValidationError] = useState<string | null>(null)\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const messages = validationMessages ?? {}\n const visibleError = errorMessage ?? validationError\n\n const validate = (candidate: InputValue) =>\n validateInputValue(candidate, {\n required: Boolean(required),\n type,\n min,\n max,\n mask,\n messages,\n })\n\n const formattedValue = useMemo(\n () =>\n formatInputValue(\n currentValue,\n type,\n locale,\n decimalScale,\n currency,\n mask,\n ),\n [currentValue, currency, decimalScale, locale, mask, type],\n )\n\n const buildPayload = (\n rawValue: InputValue,\n eventType: InputEventType,\n char: string | null = null,\n ): InputPayload => ({\n rawValue,\n formattedValue: formatInputValue(\n rawValue,\n type,\n locale,\n decimalScale,\n currency,\n mask,\n ),\n error: Boolean(validate(rawValue)),\n char,\n eventType,\n })\n\n const emitChange = (payload: InputPayload, immediate = false) => {\n if (!controlled) setLocalValue(payload.rawValue)\n if (debounceRef.current) clearTimeout(debounceRef.current)\n if (!onChange) return\n if (immediate || debounceMs <= 0) onChange(payload)\n else debounceRef.current = setTimeout(() => onChange(payload), debounceMs)\n }\n\n useEffect(() => () => {\n if (debounceRef.current) clearTimeout(debounceRef.current)\n }, [])\n\n useEffect(() => {\n if (validateOnSubmit) setValidationError(validate(currentValue))\n // Validation intentionally runs when submit state changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [validateOnSubmit])\n\n const normalize = (text: string): InputValue => {\n if (type === 'phone' && mask) return text.replace(/\\D/g, '')\n if (isFormattedInputType(type)) {\n const parsed = parseInputNumber(text, locale)\n if (parsed === null) return text === '' ? null : text\n return allowNegative ? parsed : Math.abs(parsed)\n }\n return text\n }\n\n const handleChange = (text: string) => {\n const digits = text.replace(/\\D/g, '')\n if (\n limit &&\n (isFormattedInputType(type) || type === 'phone') &&\n digits.length > limit\n ) return\n if (limit && isLengthValidatedInputType(type) && text.length > limit) return\n const rawValue = normalize(text)\n if (typeof rawValue === 'number') {\n if (typeof min === 'number' && rawValue < min) return\n if (typeof max === 'number' && rawValue > max) return\n }\n setEditingValue(\n type === 'phone' && mask ? applyInputMask(rawValue, mask) : text,\n )\n emitChange(buildPayload(rawValue, 'change', text.slice(-1) || null))\n }\n\n const describedBy = [\n ariaDescribedBy,\n hint && !visibleError ? hintId : undefined,\n visibleError ? errorId : undefined,\n ].filter(Boolean).join(' ') || undefined\n\n if (readOnly) {\n return (\n <div className={['inconel-field', `inconel-size-${size}`, fullWidth ? 'inconel-field--full-width' : '', className ?? ''].join(' ')}>\n {label && <span className={['inconel-field__label', labelClassName ?? ''].join(' ')}>{label}</span>}\n <div className=\"inconel-input-readonly\" aria-label={label}>\n {formattedValue || readOnlyEmptyValue}\n </div>\n </div>\n )\n }\n\n return (\n <div className={['inconel-field', `inconel-size-${size}`, fullWidth ? 'inconel-field--full-width' : '', className ?? ''].join(' ')}>\n {label && (\n <label className={['inconel-field__label', labelClassName ?? ''].join(' ')} htmlFor={inputId}>\n {label}{required && <span className=\"inconel-field__required\" aria-hidden=\"true\"> *</span>}\n </label>\n )}\n <div className={['inconel-input-control', variant === 'plain' ? 'inconel-input-control--plain' : '', visibleError ? 'inconel-is-invalid' : '', disabled ? 'inconel-is-disabled' : ''].join(' ')}>\n {startAdornment && <span className=\"inconel-input-adornment\" aria-hidden=\"true\">{startAdornment}</span>}\n <input\n {...inputProps}\n ref={ref}\n id={inputId}\n type={type === 'password' || type === 'email' ? type : 'text'}\n inputMode={isFormattedInputType(type) ? 'decimal' : type === 'phone' ? 'tel' : undefined}\n value={focused ? editingValue : formattedValue}\n required={required}\n disabled={disabled}\n autoComplete={autoComplete}\n aria-invalid={Boolean(visibleError)}\n aria-describedby={describedBy}\n className={['inconel-input', inputClassName ?? ''].join(' ')}\n onChange={(event) => handleChange(event.target.value)}\n onFocus={(event) => {\n if (disabled) return\n setFocused(true)\n const editValue = type === 'phone' && mask\n ? applyInputMask(currentValue, mask)\n : isFormattedInputType(type)\n ? String(currentValue ?? '').replace('.', getInputSeparators(locale).decimal)\n : String(currentValue ?? '')\n setEditingValue(editValue)\n onFocus?.(buildPayload(currentValue, 'focus'), event)\n }}\n onBlur={(event) => {\n setFocused(false)\n if (debounceRef.current) clearTimeout(debounceRef.current)\n let rawValue = normalize(editingValue)\n if (typeof rawValue === 'number') {\n rawValue = roundInputNumber(rawValue, decimalScale, roundOnBlur ? roundMode : 'floor')\n }\n setValidationError(validate(rawValue))\n const payload = buildPayload(rawValue, 'blur')\n emitChange(payload, true)\n onBlur?.(payload, event)\n }}\n onKeyDown={(event) => {\n if (!allowNegative && (event.key === '-' || event.key === 'Subtract')) event.preventDefault()\n onKeyDown?.(buildPayload(currentValue, 'keydown', event.key), event)\n }}\n onMouseEnter={(event) => onMouseEnter?.(buildPayload(currentValue, 'mouseenter'), event)}\n onMouseLeave={(event) => onMouseLeave?.(buildPayload(currentValue, 'mouseleave'), event)}\n />\n {isClearable && !disabled && formattedValue && (\n <button\n type=\"button\"\n className=\"inconel-input-clear\"\n aria-label={resolvedClearButtonLabel}\n onClick={() => {\n setEditingValue('')\n setValidationError(validate(null))\n emitChange(buildPayload(null, 'clear'), true)\n }}\n >\n ×\n </button>\n )}\n {endAdornment && <span className=\"inconel-input-adornment\" aria-hidden=\"true\">{endAdornment}</span>}\n </div>\n <FieldFeedback\n hint={hint}\n errorMessage={visibleError}\n hintId={hintId}\n errorId={errorId}\n />\n </div>\n )\n})\n\nexport default Input\n"],"names":["Input","forwardRef","id","label","hint","errorMessage","startAdornment","endAdornment","fullWidth","inputClassName","labelClassName","className","required","disabled","value","defaultValue","onChange","onBlur","onFocus","onKeyDown","onMouseEnter","onMouseLeave","type","locale","currency","decimalScale","roundMode","roundOnBlur","min","max","allowNegative","debounceMs","validateOnSubmit","validationMessages","mask","limit","isClearable","readOnly","clearButtonLabel","readOnlyEmptyValue","size","variant","autoComplete","ariaDescribedBy","inputProps","ref","adapters","useInconelAdapters","resolvedClearButtonLabel","generatedId","useId","inputId","hintId","errorId","controlled","localValue","setLocalValue","useState","currentValue","editingValue","setEditingValue","focused","setFocused","validationError","setValidationError","debounceRef","useRef","messages","visibleError","validate","candidate","validateInputValue","formattedValue","useMemo","formatInputValue","buildPayload","rawValue","eventType","char","emitChange","payload","immediate","useEffect","normalize","text","isFormattedInputType","parsed","parseInputNumber","handleChange","digits","isLengthValidatedInputType","applyInputMask","describedBy","jsx","jsxs","event","editValue","getInputSeparators","roundInputNumber","FieldFeedback"],"mappings":"2aAuIMA,GAAQC,EAAAA,WAAyC,SACrD,CACE,GAAAC,EACA,MAAAC,EACA,KAAAC,EACA,aAAAC,EACA,eAAAC,EACA,aAAAC,EACA,UAAAC,EAAY,GACZ,eAAAC,EACA,eAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EACA,MAAAC,EACA,aAAAC,EAAe,GACf,SAAAC,EACA,OAAAC,EACA,QAAAC,EACA,UAAAC,EACA,aAAAC,EACA,aAAAC,EACA,KAAAC,EAAO,OACP,OAAAC,EAAS,QACT,SAAAC,EAAW,MACX,aAAAC,EAAe,EACf,UAAAC,GAAY,QACZ,YAAAC,GAAc,GACd,IAAAC,EACA,IAAAC,EACA,cAAAC,EAAgB,GAChB,WAAAC,EAAa,EACb,iBAAAC,EAAmB,GACnB,mBAAAC,GACA,KAAAC,EACA,MAAAC,EACA,YAAAC,GAAc,GACd,SAAAC,GAAW,GACX,iBAAAC,GACA,mBAAAC,GAAqB,KACrB,KAAAC,EAAO,KACP,QAAAC,GAA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bY,EAAgB,EAAE,EAClBI,EAAmBK,EAAS,IAAI,CAAC,EACjCU,EAAWJ,EAAa,KAAM,OAAO,EAAG,EAAI,CAC9C,EACD,SAAA,GAAA,CAAA,EAIFpE,GAAgBsF,EAAAA,IAAC,OAAA,CAAK,UAAU,0BAA0B,cAAY,OAAQ,SAAAtF,CAAA,CAAa,CAAA,EAC9F,EACAsF,EAAAA,IAACM,GAAAA,QAAA,CACC,KAAA/F,EACA,aAAcgE,EACd,OAAAhB,EACA,QAAAC,CAAA,CAAA,CACF,EACF,CAEJ,CAAC"}
@@ -17,10 +17,12 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
17
17
  fullWidth?: boolean;
18
18
  variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'warning' | 'dark';
19
19
  size?: ControlSize;
20
+ fixedHeight?: boolean;
21
+ height?: number | string;
20
22
  pill?: boolean;
21
23
  count?: ReactNode;
22
24
  progress?: number | null;
23
25
  progressColor?: string | null;
24
26
  }
25
- export declare function Button({ loading, fullWidth, variant, label, buttonType, icon, iconClassName, iconWidth, iconHeight, iconRight, render, debounceTime, isActive, onClick, disabled, className, children, size, pill, count, progress, progressColor, ...props }: ButtonProps): import("react").JSX.Element | null;
27
+ export declare function Button({ loading, fullWidth, variant, label, buttonType, icon, iconClassName, iconWidth, iconHeight, iconRight, render, debounceTime, isActive, onClick, disabled, className, children, size, fixedHeight, height, pill, count, progress, progressColor, style, ...props }: ButtonProps): import("react").JSX.Element | null;
26
28
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,OAAO,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,EAEL,K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WAAW,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,wBAAgB,MAAM,CAAC,EACrB,OAAe,EACf,SAAiB,EACjB,OAAmB,EACnB,KAAK,EACL,UAAU,EACV,IAAI,EACJ,aAAa,EACb,SAAS,EACT,UAAU,EACV,SAAiB,EACjB,MAAa,EACb,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,IAAW,EACX,WAAkB,EAClB,MAAM,EACN,IAAY,EACZ,KAAK,EACL,QAAQ,EACR,aAAa,EACb,KAAK,EACL,GAAG,KAAK,EACT,EAAE,WAAW,sCAmFb"}
@@ -1,105 +1,109 @@
1
- import { jsx as e, jsxs as I } from "react/jsx-runtime";
2
- import { useMemo as T, useEffect as B } from "react";
3
- import { classNames as N } from "../shared/classNames.js";
1
+ import { jsx as e, jsxs as g } from "react/jsx-runtime";
2
+ import { useMemo as z, useEffect as D } from "react";
3
+ import { classNames as v } from "../shared/classNames.js";
4
4
  /* empty css */
5
- import { BUTTON_TYPE_CLASS_NAMES as Y } from "./constants.js";
5
+ import { BUTTON_TYPE_CLASS_NAMES as L } from "./constants.js";
6
6
  /* empty css */
7
- import { createDebouncedCallback as $ } from "./utils.js";
8
- import z from "../Svg/Svg.js";
9
- function J({
7
+ import { createDebouncedCallback as O } from "./utils.js";
8
+ import P from "../Svg/Svg.js";
9
+ function V({
10
10
  loading: n = !1,
11
- fullWidth: y = !1,
12
- variant: M = "primary",
13
- label: S,
14
- buttonType: v,
15
- icon: t,
16
- iconClassName: x,
17
- iconWidth: o,
18
- iconHeight: l,
19
- iconRight: i = !1,
20
- render: k = !0,
21
- debounceTime: m,
22
- isActive: r,
23
- onClick: d,
24
- disabled: s,
25
- className: w,
26
- children: A,
27
- size: E = "md",
28
- pill: g = !1,
29
- count: p,
30
- progress: f,
31
- progressColor: j,
32
- ...b
11
+ fullWidth: S = !1,
12
+ variant: x = "primary",
13
+ label: M,
14
+ buttonType: k,
15
+ icon: o,
16
+ iconClassName: w,
17
+ iconWidth: l,
18
+ iconHeight: r,
19
+ iconRight: s = !1,
20
+ render: A = !0,
21
+ debounceTime: d,
22
+ isActive: i,
23
+ onClick: p,
24
+ disabled: a,
25
+ className: E,
26
+ children: j,
27
+ size: C = "md",
28
+ fixedHeight: I = !0,
29
+ height: t,
30
+ pill: T = !1,
31
+ count: f,
32
+ progress: b,
33
+ progressColor: $,
34
+ style: _,
35
+ ...N
33
36
  }) {
34
- const C = v ?? M, a = T(
35
- () => $(d, m ?? 0),
36
- [d, m]
37
+ const B = k ?? x, Y = !I && t !== void 0 ? { ..._, "--inconel-control-height": typeof t == "number" ? `${t}px` : t } : _, c = z(
38
+ () => O(p, d ?? 0),
39
+ [p, d]
37
40
  );
38
- if (B(() => () => a.cancel(), [a]), !k) return null;
39
- const _ = S ?? A, c = typeof f == "number" ? Math.max(0, Math.min(100, f)) : null, h = typeof t == "string" && t ? /* @__PURE__ */ e(
41
+ if (D(() => () => c.cancel(), [c]), !A) return null;
42
+ const h = M ?? j, u = typeof b == "number" ? Math.max(0, Math.min(100, b)) : null, y = typeof o == "string" && o ? /* @__PURE__ */ e(
40
43
  "span",
41
44
  {
42
- className: N(
45
+ className: v(
43
46
  "inconel-button__icon",
44
- i ? "inconel-button__icon--right" : "inconel-button__icon--left",
45
- x
47
+ s ? "inconel-button__icon--right" : "inconel-button__icon--left",
48
+ w
46
49
  ),
47
- style: { width: o ?? void 0, height: l ?? void 0 },
50
+ style: { width: l ?? void 0, height: r ?? void 0 },
48
51
  "aria-hidden": "true",
49
52
  children: /* @__PURE__ */ e(
50
- z,
53
+ P,
51
54
  {
52
- src: t,
55
+ src: o,
53
56
  renumerateIRIElements: !1,
54
57
  loading: () => null,
55
58
  fallback: () => null,
56
- beforeInjection: (u) => {
57
- o && u.setAttribute("width", String(o)), l && u.setAttribute("height", String(l)), u.setAttribute("preserveAspectRatio", "xMidYMid meet");
59
+ beforeInjection: (m) => {
60
+ l && m.setAttribute("width", String(l)), r && m.setAttribute("height", String(r)), m.setAttribute("preserveAspectRatio", "xMidYMid meet");
58
61
  }
59
62
  }
60
63
  )
61
64
  }
62
65
  ) : null;
63
- return /* @__PURE__ */ I(
66
+ return /* @__PURE__ */ g(
64
67
  "button",
65
68
  {
66
- ...b,
67
- disabled: s || n,
68
- "aria-pressed": typeof r == "boolean" ? r : b["aria-pressed"],
69
- onClick: s || n ? void 0 : a,
70
- className: N(
69
+ ...N,
70
+ style: Y,
71
+ disabled: a || n,
72
+ "aria-pressed": typeof i == "boolean" ? i : N["aria-pressed"],
73
+ onClick: a || n ? void 0 : c,
74
+ className: v(
71
75
  "inconel-button",
72
- `inconel-size-${E}`,
73
- Y[C],
74
- y && "inconel-button--full-width",
75
- c !== null && "inconel-button--has-progress",
76
- g && "inconel-button--pill",
76
+ `inconel-size-${C}`,
77
+ L[B],
78
+ S && "inconel-button--full-width",
79
+ u !== null && "inconel-button--has-progress",
80
+ T && "inconel-button--pill",
77
81
  n && "inconel-is-loading",
78
- s && "inconel-is-disabled",
79
- r && "inconel-is-active",
80
- w
82
+ a && "inconel-is-disabled",
83
+ i && "inconel-is-active",
84
+ E
81
85
  ),
82
86
  children: [
83
- c !== null && /* @__PURE__ */ e(
87
+ u !== null && /* @__PURE__ */ e(
84
88
  "span",
85
89
  {
86
90
  className: "inconel-button__progress",
87
91
  style: {
88
- width: `${c}%`,
89
- background: j ?? void 0
92
+ width: `${u}%`,
93
+ background: $ ?? void 0
90
94
  }
91
95
  }
92
96
  ),
93
97
  n && /* @__PURE__ */ e("span", { className: "inconel-button__spinner", "aria-hidden": "true" }),
94
- !i && h,
95
- _ !== void 0 && /* @__PURE__ */ e("span", { className: "inconel-button__title", children: _ }),
96
- i && h,
97
- p != null && /* @__PURE__ */ e("span", { className: "inconel-button__count", children: p })
98
+ !s && y,
99
+ h !== void 0 && /* @__PURE__ */ e("span", { className: "inconel-button__title", children: h }),
100
+ s && y,
101
+ f != null && /* @__PURE__ */ e("span", { className: "inconel-button__count", children: f })
98
102
  ]
99
103
  }
100
104
  );
101
105
  }
102
106
  export {
103
- J as Button
107
+ V as Button
104
108
  };
105
109
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type ButtonHTMLAttributes,\n type ReactNode,\n} from 'react'\n\nimport { classNames } from '../shared/classNames'\nimport '../shared/sizes.css'\nimport type { ControlSize } from '../shared/types'\nimport { Svg } from '../Svg'\nimport {\n BUTTON_TYPE_CLASS_NAMES,\n type ButtonType,\n} from './constants'\nimport './styles.css'\nimport { createDebouncedCallback } from './utils'\n\nexport interface ButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n label?: ReactNode\n buttonType?: ButtonType\n icon?: string | null\n iconClassName?: string\n iconWidth?: number | null\n iconHeight?: number | null\n iconRight?: boolean\n render?: boolean\n debounceTime?: number | null\n isActive?: boolean | null\n onChange?: ButtonHTMLAttributes<HTMLButtonElement>['onChange']\n loading?: boolean\n fullWidth?: boolean\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'warning' | 'dark'\n size?: ControlSize\n pill?: boolean\n count?: ReactNode\n progress?: number | null\n progressColor?: string | null\n}\n\nexport function Button({\n loading = false,\n fullWidth = false,\n variant = 'primary',\n label,\n buttonType,\n icon,\n iconClassName,\n iconWidth,\n iconHeight,\n iconRight = false,\n render = true,\n debounceTime,\n isActive,\n onClick,\n disabled,\n className,\n children,\n size = 'md',\n pill = false,\n count,\n progress,\n progressColor,\n ...props\n}: ButtonProps) {\n const resolvedType = buttonType ?? variant\n const debouncedClick = useMemo(\n () => createDebouncedCallback(onClick, debounceTime ?? 0),\n [onClick, debounceTime],\n )\n\n useEffect(() => () => debouncedClick.cancel(), [debouncedClick])\n\n if (!render) return null\n\n const content = label ?? children\n const progressWidth =\n typeof progress === 'number' ? Math.max(0, Math.min(100, progress)) : null\n const iconNode = typeof icon === 'string' && icon ? (\n <span\n className={classNames(\n 'inconel-button__icon',\n iconRight\n ? 'inconel-button__icon--right'\n : 'inconel-button__icon--left',\n iconClassName,\n )}\n style={{ width: iconWidth ?? undefined, height: iconHeight ?? undefined }}\n aria-hidden=\"true\"\n >\n <Svg\n src={icon}\n renumerateIRIElements={false}\n loading={() => null}\n fallback={() => null}\n beforeInjection={(svg) => {\n if (iconWidth) svg.setAttribute('width', String(iconWidth))\n if (iconHeight) svg.setAttribute('height', String(iconHeight))\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet')\n }}\n />\n </span>\n ) : null\n\n return (\n <button\n {...props}\n disabled={disabled || loading}\n aria-pressed={\n typeof isActive === 'boolean' ? isActive : props['aria-pressed']\n }\n onClick={disabled || loading ? undefined : debouncedClick}\n className={classNames(\n 'inconel-button',\n `inconel-size-${size}`,\n BUTTON_TYPE_CLASS_NAMES[resolvedType],\n fullWidth && 'inconel-button--full-width',\n progressWidth !== null && 'inconel-button--has-progress',\n pill && 'inconel-button--pill',\n loading && 'inconel-is-loading',\n disabled && 'inconel-is-disabled',\n isActive && 'inconel-is-active',\n className,\n )}\n >\n {progressWidth !== null && (\n <span\n className=\"inconel-button__progress\"\n style={{\n width: `${progressWidth}%`,\n background: progressColor ?? undefined,\n }}\n />\n )}\n {loading && <span className=\"inconel-button__spinner\" aria-hidden=\"true\" />}\n {!iconRight && iconNode}\n {content !== undefined && (\n <span className=\"inconel-button__title\">{content}</span>\n )}\n {iconRight && iconNode}\n {count != null && <span className=\"inconel-button__count\">{count}</span>}\n </button>\n )\n}\n"],"names":["Button","loading","fullWidth","variant","label","buttonType","icon","iconClassName","iconWidth","iconHeight","iconRight","render","debounceTime","isActive","onClick","disabled","className","children","size","pill","count","progress","progressColor","props","resolvedType","debouncedClick","useMemo","createDebouncedCallback","useEffect","content","progressWidth","iconNode","jsx","classNames","Svg","svg","jsxs","BUTTON_TYPE_CLASS_NAMES"],"mappings":";;;;;;;;AAyCO,SAASA,EAAO;AAAA,EACrB,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC,IAAS;AAAA,EACT,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,GAAgB;AACd,QAAMC,IAAenB,KAAcF,GAC7BsB,IAAiBC;AAAA,IACrB,MAAMC,EAAwBb,GAASF,KAAgB,CAAC;AAAA,IACxD,CAACE,GAASF,CAAY;AAAA,EAAA;AAKxB,MAFAgB,EAAU,MAAM,MAAMH,EAAe,UAAU,CAACA,CAAc,CAAC,GAE3D,CAACd,EAAQ,QAAO;AAEpB,QAAMkB,IAAUzB,KAASa,GACnBa,IACJ,OAAOT,KAAa,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,KAAKA,CAAQ,CAAC,IAAI,MAClEU,IAAW,OAAOzB,KAAS,YAAYA,IAC3C,gBAAA0B;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAvB,IACI,gCACA;AAAA,QACJH;AAAA,MAAA;AAAA,MAEF,OAAO,EAAE,OAAOC,KAA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,UAAAH,GAAQ;AAAA,QAElDnB,KAAaqB;AAAA,QACbX,KAAS,QAAQ,gBAAAY,EAAC,QAAA,EAAK,WAAU,yBAAyB,UAAAZ,EAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGvE;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n type ButtonHTMLAttributes,\n type ReactNode,\n} from 'react'\n\nimport { classNames } from '../shared/classNames'\nimport '../shared/sizes.css'\nimport type { ControlSize } from '../shared/types'\nimport { Svg } from '../Svg'\nimport {\n BUTTON_TYPE_CLASS_NAMES,\n type ButtonType,\n} from './constants'\nimport './styles.css'\nimport { createDebouncedCallback } from './utils'\n\nexport interface ButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n label?: ReactNode\n buttonType?: ButtonType\n icon?: string | null\n iconClassName?: string\n iconWidth?: number | null\n iconHeight?: number | null\n iconRight?: boolean\n render?: boolean\n debounceTime?: number | null\n isActive?: boolean | null\n onChange?: ButtonHTMLAttributes<HTMLButtonElement>['onChange']\n loading?: boolean\n fullWidth?: boolean\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'warning' | 'dark'\n size?: ControlSize\n fixedHeight?: boolean\n height?: number | string\n pill?: boolean\n count?: ReactNode\n progress?: number | null\n progressColor?: string | null\n}\n\nexport function Button({\n loading = false,\n fullWidth = false,\n variant = 'primary',\n label,\n buttonType,\n icon,\n iconClassName,\n iconWidth,\n iconHeight,\n iconRight = false,\n render = true,\n debounceTime,\n isActive,\n onClick,\n disabled,\n className,\n children,\n size = 'md',\n fixedHeight = true,\n height,\n pill = false,\n count,\n progress,\n progressColor,\n style,\n ...props\n}: ButtonProps) {\n const resolvedType = buttonType ?? variant\n const resolvedStyle = !fixedHeight && height !== undefined\n ? { ...style, '--inconel-control-height': typeof height === 'number' ? `${height}px` : height } as typeof style\n : style\n const debouncedClick = useMemo(\n () => createDebouncedCallback(onClick, debounceTime ?? 0),\n [onClick, debounceTime],\n )\n\n useEffect(() => () => debouncedClick.cancel(), [debouncedClick])\n\n if (!render) return null\n\n const content = label ?? children\n const progressWidth =\n typeof progress === 'number' ? Math.max(0, Math.min(100, progress)) : null\n const iconNode = typeof icon === 'string' && icon ? (\n <span\n className={classNames(\n 'inconel-button__icon',\n iconRight\n ? 'inconel-button__icon--right'\n : 'inconel-button__icon--left',\n iconClassName,\n )}\n style={{ width: iconWidth ?? undefined, height: iconHeight ?? undefined }}\n aria-hidden=\"true\"\n >\n <Svg\n src={icon}\n renumerateIRIElements={false}\n loading={() => null}\n fallback={() => null}\n beforeInjection={(svg) => {\n if (iconWidth) svg.setAttribute('width', String(iconWidth))\n if (iconHeight) svg.setAttribute('height', String(iconHeight))\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet')\n }}\n />\n </span>\n ) : null\n\n return (\n <button\n {...props}\n style={resolvedStyle}\n disabled={disabled || loading}\n aria-pressed={\n typeof isActive === 'boolean' ? isActive : props['aria-pressed']\n }\n onClick={disabled || loading ? undefined : debouncedClick}\n className={classNames(\n 'inconel-button',\n `inconel-size-${size}`,\n BUTTON_TYPE_CLASS_NAMES[resolvedType],\n fullWidth && 'inconel-button--full-width',\n progressWidth !== null && 'inconel-button--has-progress',\n pill && 'inconel-button--pill',\n loading && 'inconel-is-loading',\n disabled && 'inconel-is-disabled',\n isActive && 'inconel-is-active',\n className,\n )}\n >\n {progressWidth !== null && (\n <span\n className=\"inconel-button__progress\"\n style={{\n width: `${progressWidth}%`,\n background: progressColor ?? undefined,\n }}\n />\n )}\n {loading && <span className=\"inconel-button__spinner\" aria-hidden=\"true\" />}\n {!iconRight && iconNode}\n {content !== undefined && (\n <span className=\"inconel-button__title\">{content}</span>\n )}\n {iconRight && iconNode}\n {count != null && <span className=\"inconel-button__count\">{count}</span>}\n </button>\n )\n}\n"],"names":["Button","loading","fullWidth","variant","label","buttonType","icon","iconClassName","iconWidth","iconHeight","iconRight","render","debounceTime","isActive","onClick","disabled","className","children","size","fixedHeight","height","pill","count","progress","progressColor","style","props","resolvedType","resolvedStyle","debouncedClick","useMemo","createDebouncedCallback","useEffect","content","progressWidth","iconNode","jsx","classNames","Svg","svg","jsxs","BUTTON_TYPE_CLASS_NAMES"],"mappings":";;;;;;;;AA2CO,SAASA,EAAO;AAAA,EACrB,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC,IAAS;AAAA,EACT,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC,IAAc;AAAA,EACd,QAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GAAgB;AACd,QAAMC,IAAetB,KAAcF,GAC7ByB,IAAgB,CAACT,KAAeC,MAAW,SAC7C,EAAE,GAAGK,GAAO,4BAA4B,OAAOL,KAAW,WAAW,GAAGA,CAAM,OAAOA,MACrFK,GACEI,IAAiBC;AAAA,IACrB,MAAMC,EAAwBjB,GAASF,KAAgB,CAAC;AAAA,IACxD,CAACE,GAASF,CAAY;AAAA,EAAA;AAKxB,MAFAoB,EAAU,MAAM,MAAMH,EAAe,UAAU,CAACA,CAAc,CAAC,GAE3D,CAAClB,EAAQ,QAAO;AAEpB,QAAMsB,IAAU7B,KAASa,GACnBiB,IACJ,OAAOX,KAAa,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,KAAKA,CAAQ,CAAC,IAAI,MAClEY,IAAW,OA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AAC,EAAE,SAAS,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,kBAAkB,CAAC,EAAE,uBAAuB,CAAA;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kBAAkB,CAAC,EAAE,SAAS,CAAA;IAC9B,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CAC/B;AAED,QAAA,MAAM,KAAK,yGA0PT,CAAA;AAEF,eAAe,KAAK,CAAA"}
@@ -1,118 +1,119 @@
1
1
  import { jsxs as b, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as we, useId as Ee, useState as I, useRef as Fe, useMemo as Me, useEffect as X } from "react";
3
- import _e from "../FieldFeedback/FieldFeedback.js";
2
+ import { forwardRef as Ee, useId as Fe, useState as I, useRef as Me, useMemo as _e, useEffect as U } from "react";
3
+ import Re from "../FieldFeedback/FieldFeedback.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  /* empty css */
8
- import { formatInputValue as Z, applyInputMask as k, isFormattedInputType as v, getInputSeparators as Be, validateInputValue as Re, parseInputNumber as $e, isLengthValidatedInputType as De, roundInputNumber as ze } from "./utils.js";
9
- const He = we(function({
10
- id: O,
8
+ import { formatInputValue as X, applyInputMask as Z, isFormattedInputType as v, getInputSeparators as $e, validateInputValue as ze, parseInputNumber as De, isLengthValidatedInputType as Le, roundInputNumber as Ce } from "./utils.js";
9
+ import { useInconelAdapters as Se } from "../../adapters/context.js";
10
+ const Xe = Ee(function({
11
+ id: k,
11
12
  label: s,
12
- hint: B,
13
- errorMessage: W,
13
+ hint: _,
14
+ errorMessage: A,
14
15
  startAdornment: R,
15
16
  endAdornment: $,
16
- fullWidth: D = !1,
17
- inputClassName: A,
18
- labelClassName: z,
17
+ fullWidth: z = !1,
18
+ inputClassName: O,
19
+ labelClassName: D,
19
20
  className: L,
20
21
  required: V,
21
22
  disabled: f,
22
23
  value: C,
23
- defaultValue: x = "",
24
+ defaultValue: W = "",
24
25
  onChange: N,
25
- onBlur: ee,
26
- onFocus: ne,
27
- onKeyDown: re,
28
- onMouseEnter: oe,
29
- onMouseLeave: ie,
26
+ onBlur: x,
27
+ onFocus: ee,
28
+ onKeyDown: ne,
29
+ onMouseEnter: re,
30
+ onMouseLeave: oe,
30
31
  type: n = "text",
31
32
  locale: c = "tr-TR",
32
- currency: j = "TRY",
33
+ currency: T = "TRY",
33
34
  decimalScale: p = 0,
34
- roundMode: le = "floor",
35
- roundOnBlur: te = !1,
36
- min: T,
37
- max: w,
38
- allowNegative: K = !1,
39
- debounceMs: P = 0,
40
- validateOnSubmit: S = !1,
41
- validationMessages: ue,
35
+ roundMode: ie = "floor",
36
+ roundOnBlur: le = !1,
37
+ min: j,
38
+ max: B,
39
+ allowNegative: S = !1,
40
+ debounceMs: K = 0,
41
+ validateOnSubmit: P = !1,
42
+ validationMessages: te,
42
43
  mask: l,
43
- limit: h,
44
+ limit: m,
44
45
  isClearable: ae = !1,
45
- readOnly: se = !1,
46
- clearButtonLabel: Y,
46
+ readOnly: ue = !1,
47
+ clearButtonLabel: se,
47
48
  readOnlyEmptyValue: ce = null,
48
- size: q = "md",
49
+ size: Y = "md",
49
50
  variant: de = "outlined",
50
51
  autoComplete: fe = "off",
51
52
  "aria-describedby": pe,
52
- ...he
53
- }, me) {
54
- const ge = Ee(), m = O ?? `inconel-input-${ge.replace(/:/g, "")}`, y = `${m}-hint`, G = `${m}-error`, H = C !== void 0, [be, Ie] = I(x), o = H ? C : be, [J, E] = I(""), [ve, Q] = I(!1), [Ve, F] = I(null), u = Fe(null), Ne = ue ?? {}, d = W ?? Ve, g = (e) => Re(e, {
53
+ ...me
54
+ }, he) {
55
+ const ge = Se(), be = se ?? String(ge.translate?.("clear", "Temizle") ?? "Temizle"), Ie = Fe(), h = k ?? `inconel-input-${Ie.replace(/:/g, "")}`, q = `${h}-hint`, y = `${h}-error`, G = C !== void 0, [ve, Ve] = I(W), o = G ? C : ve, [H, w] = I(""), [Ne, J] = I(!1), [Te, E] = I(null), a = Me(null), je = te ?? {}, d = A ?? Te, g = (e) => ze(e, {
55
56
  required: !!V,
56
57
  type: n,
57
- min: T,
58
- max: w,
58
+ min: j,
59
+ max: B,
59
60
  mask: l,
60
- messages: Ne
61
- }), M = Me(
62
- () => Z(
61
+ messages: je
62
+ }), F = _e(
63
+ () => X(
63
64
  o,
64
65
  n,
65
66
  c,
66
67
  p,
67
- j,
68
+ T,
68
69
  l
69
70
  ),
70
- [o, j, p, c, l, n]
71
- ), a = (e, r, i = null) => ({
71
+ [o, T, p, c, l, n]
72
+ ), u = (e, r, i = null) => ({
72
73
  rawValue: e,
73
- formattedValue: Z(
74
+ formattedValue: X(
74
75
  e,
75
76
  n,
76
77
  c,
77
78
  p,
78
- j,
79
+ T,
79
80
  l
80
81
  ),
81
82
  error: !!g(e),
82
83
  char: i,
83
84
  eventType: r
84
- }), _ = (e, r = !1) => {
85
- H || Ie(e.rawValue), u.current && clearTimeout(u.current), N && (r || P <= 0 ? N(e) : u.current = setTimeout(() => N(e), P));
85
+ }), M = (e, r = !1) => {
86
+ G || Ve(e.rawValue), a.current && clearTimeout(a.current), N && (r || K <= 0 ? N(e) : a.current = setTimeout(() => N(e), K));
86
87
  };
87
- X(() => () => {
88
- u.current && clearTimeout(u.current);
89
- }, []), X(() => {
90
- S && F(g(o));
91
- }, [S]);
92
- const U = (e) => {
88
+ U(() => () => {
89
+ a.current && clearTimeout(a.current);
90
+ }, []), U(() => {
91
+ P && E(g(o));
92
+ }, [P]);
93
+ const Q = (e) => {
93
94
  if (n === "phone" && l) return e.replace(/\D/g, "");
94
95
  if (v(n)) {
95
- const r = $e(e, c);
96
- return r === null ? e === "" ? null : e : K ? r : Math.abs(r);
96
+ const r = De(e, c);
97
+ return r === null ? e === "" ? null : e : S ? r : Math.abs(r);
97
98
  }
98
99
  return e;
99
- }, je = (e) => {
100
+ }, Be = (e) => {
100
101
  const r = e.replace(/\D/g, "");
101
- if (h && (v(n) || n === "phone") && r.length > h || h && De(n) && e.length > h) return;
102
- const i = U(e);
103
- typeof i == "number" && (typeof T == "number" && i < T || typeof w == "number" && i > w) || (E(
104
- n === "phone" && l ? k(i, l) : e
105
- ), _(a(i, "change", e.slice(-1) || null)));
106
- }, Te = [
102
+ if (m && (v(n) || n === "phone") && r.length > m || m && Le(n) && e.length > m) return;
103
+ const i = Q(e);
104
+ typeof i == "number" && (typeof j == "number" && i < j || typeof B == "number" && i > B) || (w(
105
+ n === "phone" && l ? Z(i, l) : e
106
+ ), M(u(i, "change", e.slice(-1) || null)));
107
+ }, we = [
107
108
  pe,
108
- B && !d ? y : void 0,
109
- d ? G : void 0
109
+ _ && !d ? q : void 0,
110
+ d ? y : void 0
110
111
  ].filter(Boolean).join(" ") || void 0;
111
- return se ? /* @__PURE__ */ b("div", { className: ["inconel-field", `inconel-size-${q}`, D ? "inconel-field--full-width" : "", L ?? ""].join(" "), children: [
112
- s && /* @__PURE__ */ t("span", { className: ["inconel-field__label", z ?? ""].join(" "), children: s }),
113
- /* @__PURE__ */ t("div", { className: "inconel-input-readonly", "aria-label": s, children: M || ce })
114
- ] }) : /* @__PURE__ */ b("div", { className: ["inconel-field", `inconel-size-${q}`, D ? "inconel-field--full-width" : "", L ?? ""].join(" "), children: [
115
- s && /* @__PURE__ */ b("label", { className: ["inconel-field__label", z ?? ""].join(" "), htmlFor: m, children: [
112
+ return ue ? /* @__PURE__ */ b("div", { className: ["inconel-field", `inconel-size-${Y}`, z ? "inconel-field--full-width" : "", L ?? ""].join(" "), children: [
113
+ s && /* @__PURE__ */ t("span", { className: ["inconel-field__label", D ?? ""].join(" "), children: s }),
114
+ /* @__PURE__ */ t("div", { className: "inconel-input-readonly", "aria-label": s, children: F || ce })
115
+ ] }) : /* @__PURE__ */ b("div", { className: ["inconel-field", `inconel-size-${Y}`, z ? "inconel-field--full-width" : "", L ?? ""].join(" "), children: [
116
+ s && /* @__PURE__ */ b("label", { className: ["inconel-field__label", D ?? ""].join(" "), htmlFor: h, children: [
116
117
  s,
117
118
  V && /* @__PURE__ */ t("span", { className: "inconel-field__required", "aria-hidden": "true", children: " *" })
118
119
  ] }),
@@ -121,47 +122,47 @@ const He = we(function({
121
122
  /* @__PURE__ */ t(
122
123
  "input",
123
124
  {
124
- ...he,
125
- ref: me,
126
- id: m,
125
+ ...me,
126
+ ref: he,
127
+ id: h,
127
128
  type: n === "password" || n === "email" ? n : "text",
128
129
  inputMode: v(n) ? "decimal" : n === "phone" ? "tel" : void 0,
129
- value: ve ? J : M,
130
+ value: Ne ? H : F,
130
131
  required: V,
131
132
  disabled: f,
132
133
  autoComplete: fe,
133
134
  "aria-invalid": !!d,
134
- "aria-describedby": Te,
135
- className: ["inconel-input", A ?? ""].join(" "),
136
- onChange: (e) => je(e.target.value),
135
+ "aria-describedby": we,
136
+ className: ["inconel-input", O ?? ""].join(" "),
137
+ onChange: (e) => Be(e.target.value),
137
138
  onFocus: (e) => {
138
139
  if (f) return;
139
- Q(!0);
140
- const r = n === "phone" && l ? k(o, l) : v(n) ? String(o ?? "").replace(".", Be(c).decimal) : String(o ?? "");
141
- E(r), ne?.(a(o, "focus"), e);
140
+ J(!0);
141
+ const r = n === "phone" && l ? Z(o, l) : v(n) ? String(o ?? "").replace(".", $e(c).decimal) : String(o ?? "");
142
+ w(r), ee?.(u(o, "focus"), e);
142
143
  },
143
144
  onBlur: (e) => {
144
- Q(!1), u.current && clearTimeout(u.current);
145
- let r = U(J);
146
- typeof r == "number" && (r = ze(r, p, te ? le : "floor")), F(g(r));
147
- const i = a(r, "blur");
148
- _(i, !0), ee?.(i, e);
145
+ J(!1), a.current && clearTimeout(a.current);
146
+ let r = Q(H);
147
+ typeof r == "number" && (r = Ce(r, p, le ? ie : "floor")), E(g(r));
148
+ const i = u(r, "blur");
149
+ M(i, !0), x?.(i, e);
149
150
  },
150
151
  onKeyDown: (e) => {
151
- !K && (e.key === "-" || e.key === "Subtract") && e.preventDefault(), re?.(a(o, "keydown", e.key), e);
152
+ !S && (e.key === "-" || e.key === "Subtract") && e.preventDefault(), ne?.(u(o, "keydown", e.key), e);
152
153
  },
153
- onMouseEnter: (e) => oe?.(a(o, "mouseenter"), e),
154
- onMouseLeave: (e) => ie?.(a(o, "mouseleave"), e)
154
+ onMouseEnter: (e) => re?.(u(o, "mouseenter"), e),
155
+ onMouseLeave: (e) => oe?.(u(o, "mouseleave"), e)
155
156
  }
156
157
  ),
157
- ae && !f && M && Y && /* @__PURE__ */ t(
158
+ ae && !f && F && /* @__PURE__ */ t(
158
159
  "button",
159
160
  {
160
161
  type: "button",
161
162
  className: "inconel-input-clear",
162
- "aria-label": Y,
163
+ "aria-label": be,
163
164
  onClick: () => {
164
- E(""), F(g(null)), _(a(null, "clear"), !0);
165
+ w(""), E(g(null)), M(u(null, "clear"), !0);
165
166
  },
166
167
  children: "×"
167
168
  }
@@ -169,17 +170,17 @@ const He = we(function({
169
170
  $ && /* @__PURE__ */ t("span", { className: "inconel-input-adornment", "aria-hidden": "true", children: $ })
170
171
  ] }),
171
172
  /* @__PURE__ */ t(
172
- _e,
173
+ Re,
173
174
  {
174
- hint: B,
175
+ hint: _,
175
176
  errorMessage: d,
176
- hintId: y,
177
- errorId: G
177
+ hintId: q,
178
+ errorId: y
178
179
  }
179
180
  )
180
181
  ] });
181
182
  });
182
183
  export {
183
- He as default
184
+ Xe as default
184
185
  };
185
186
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type FocusEvent,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\n\nimport FieldFeedback from '../FieldFeedback/FieldFeedback'\nimport type { FieldFeedbackContentProps } from '../FieldFeedback/FieldFeedback'\nimport '../shared/field.css'\nimport '../shared/field-controls.css'\nimport '../shared/sizes.css'\nimport type { ControlSize } from '../shared/types'\nimport './styles.css'\nimport {\n applyInputMask,\n formatInputValue,\n getInputSeparators,\n isFormattedInputType,\n isLengthValidatedInputType,\n parseInputNumber,\n roundInputNumber,\n validateInputValue,\n} from './utils'\n\nexport type InputType =\n | 'text'\n | 'number'\n | 'currency'\n | 'percent'\n | 'phone'\n | 'email'\n | 'password'\n\nexport type InputRoundMode = 'ceil' | 'floor' | 'round'\nexport type InputValue = string | number | null\nexport type InputEventType =\n | 'change'\n | 'blur'\n | 'focus'\n | 'keydown'\n | 'mouseenter'\n | 'mouseleave'\n | 'clear'\n\nexport interface InputPayload {\n rawValue: InputValue\n formattedValue: string\n error: boolean\n char: string | null\n eventType: InputEventType\n}\n\nexport interface InputValidationMessages {\n required?: string\n invalidNumber?: string\n minNumber?: string\n maxNumber?: string\n minLength?: string\n maxLength?: string\n invalidPhone?: string\n invalidEmail?: string\n}\n\ntype NativeInputProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n | 'type'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'onBlur'\n | 'onFocus'\n | 'onKeyDown'\n | 'onMouseEnter'\n | 'onMouseLeave'\n | 'min'\n | 'max'\n | 'size'\n | 'readOnly'\n>\n\nexport interface InputProps extends NativeInputProps, FieldFeedbackContentProps {\n label?: string\n startAdornment?: ReactNode\n endAdornment?: ReactNode\n fullWidth?: boolean\n inputClassName?: string\n labelClassName?: string\n value?: InputValue\n defaultValue?: InputValue\n onChange?: (payload: InputPayload) => void\n onBlur?: (payload: InputPayload, event: FocusEvent<HTMLInputElement>) => void\n onFocus?: (payload: InputPayload, event: FocusEvent<HTMLInputElement>) => void\n onKeyDown?: (\n payload: InputPayload,\n event: KeyboardEvent<HTMLInputElement>,\n ) => void\n onMouseEnter?: (\n payload: InputPayload,\n event: MouseEvent<HTMLInputElement>,\n ) => void\n onMouseLeave?: (\n payload: InputPayload,\n event: MouseEvent<HTMLInputElement>,\n ) => void\n type?: InputType\n locale?: string\n currency?: string\n decimalScale?: number\n roundMode?: InputRoundMode\n roundOnBlur?: boolean\n min?: number\n max?: number\n allowNegative?: boolean\n debounceMs?: number\n validateOnSubmit?: boolean\n validationMessages?: InputValidationMessages\n mask?: string\n limit?: number\n isClearable?: boolean\n readOnly?: boolean\n clearButtonLabel?: string\n readOnlyEmptyValue?: ReactNode\n size?: ControlSize\n variant?: 'outlined' | 'plain'\n}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n id,\n label,\n hint,\n errorMessage,\n startAdornment,\n endAdornment,\n fullWidth = false,\n inputClassName,\n labelClassName,\n className,\n required,\n disabled,\n value,\n defaultValue = '',\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onMouseEnter,\n onMouseLeave,\n type = 'text',\n locale = 'tr-TR',\n currency = 'TRY',\n decimalScale = 0,\n roundMode = 'floor',\n roundOnBlur = false,\n min,\n max,\n allowNegative = false,\n debounceMs = 0,\n validateOnSubmit = false,\n validationMessages,\n mask,\n limit,\n isClearable = false,\n readOnly = false,\n clearButtonLabel,\n readOnlyEmptyValue = null,\n size = 'md',\n variant = 'outlined',\n autoComplete = 'off',\n 'aria-describedby': ariaDescribedBy,\n ...inputProps\n },\n ref,\n) {\n const generatedId = useId()\n const inputId = id ?? `inconel-input-${generatedId.replace(/:/g, '')}`\n const hintId = `${inputId}-hint`\n const errorId = `${inputId}-error`\n const controlled = value !== undefined\n const [localValue, setLocalValue] = useState<InputValue>(defaultValue)\n const currentValue = controlled ? value : localValue\n const [editingValue, setEditingValue] = useState('')\n const [focused, setFocused] = useState(false)\n const [validationError, setValidationError] = useState<string | null>(null)\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const messages = validationMessages ?? {}\n const visibleError = errorMessage ?? validationError\n\n const validate = (candidate: InputValue) =>\n validateInputValue(candidate, {\n required: Boolean(required),\n type,\n min,\n max,\n mask,\n messages,\n })\n\n const formattedValue = useMemo(\n () =>\n formatInputValue(\n currentValue,\n type,\n locale,\n decimalScale,\n currency,\n mask,\n ),\n [currentValue, currency, decimalScale, locale, mask, type],\n )\n\n const buildPayload = (\n rawValue: InputValue,\n eventType: InputEventType,\n char: string | null = null,\n ): InputPayload => ({\n rawValue,\n formattedValue: formatInputValue(\n rawValue,\n type,\n locale,\n decimalScale,\n currency,\n mask,\n ),\n error: Boolean(validate(rawValue)),\n char,\n eventType,\n })\n\n const emitChange = (payload: InputPayload, immediate = false) => {\n if (!controlled) setLocalValue(payload.rawValue)\n if (debounceRef.current) clearTimeout(debounceRef.current)\n if (!onChange) return\n if (immediate || debounceMs <= 0) onChange(payload)\n else debounceRef.current = setTimeout(() => onChange(payload), debounceMs)\n }\n\n useEffect(() => () => {\n if (debounceRef.current) clearTimeout(debounceRef.current)\n }, [])\n\n useEffect(() => {\n if (validateOnSubmit) setValidationError(validate(currentValue))\n // Validation intentionally runs when submit state changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [validateOnSubmit])\n\n const normalize = (text: string): InputValue => {\n if (type === 'phone' && mask) return text.replace(/\\D/g, '')\n if (isFormattedInputType(type)) {\n const parsed = parseInputNumber(text, locale)\n if (parsed === null) return text === '' ? null : text\n return allowNegative ? parsed : Math.abs(parsed)\n }\n return text\n }\n\n const handleChange = (text: string) => {\n const digits = text.replace(/\\D/g, '')\n if (\n limit &&\n (isFormattedInputType(type) || type === 'phone') &&\n digits.length > limit\n ) return\n if (limit && isLengthValidatedInputType(type) && text.length > limit) return\n const rawValue = normalize(text)\n if (typeof rawValue === 'number') {\n if (typeof min === 'number' && rawValue < min) return\n if (typeof max === 'number' && rawValue > max) return\n }\n setEditingValue(\n type === 'phone' && mask ? applyInputMask(rawValue, mask) : text,\n )\n emitChange(buildPayload(rawValue, 'change', text.slice(-1) || null))\n }\n\n const describedBy = [\n ariaDescribedBy,\n hint && !visibleError ? hintId : undefined,\n visibleError ? errorId : undefined,\n ].filter(Boolean).join(' ') || undefined\n\n if (readOnly) {\n return (\n <div className={['inconel-field', `inconel-size-${size}`, fullWidth ? 'inconel-field--full-width' : '', className ?? ''].join(' ')}>\n {label && <span className={['inconel-field__label', labelClassName ?? ''].join(' ')}>{label}</span>}\n <div className=\"inconel-input-readonly\" aria-label={label}>\n {formattedValue || readOnlyEmptyValue}\n </div>\n </div>\n )\n }\n\n return (\n <div className={['inconel-field', `inconel-size-${size}`, fullWidth ? 'inconel-field--full-width' : '', className ?? ''].join(' ')}>\n {label && (\n <label className={['inconel-field__label', labelClassName ?? ''].join(' ')} htmlFor={inputId}>\n {label}{required && <span className=\"inconel-field__required\" aria-hidden=\"true\"> *</span>}\n </label>\n )}\n <div className={['inconel-input-control', variant === 'plain' ? 'inconel-input-control--plain' : '', visibleError ? 'inconel-is-invalid' : '', disabled ? 'inconel-is-disabled' : ''].join(' ')}>\n {startAdornment && <span className=\"inconel-input-adornment\" aria-hidden=\"true\">{startAdornment}</span>}\n <input\n {...inputProps}\n ref={ref}\n id={inputId}\n type={type === 'password' || type === 'email' ? type : 'text'}\n inputMode={isFormattedInputType(type) ? 'decimal' : type === 'phone' ? 'tel' : undefined}\n value={focused ? editingValue : formattedValue}\n required={required}\n disabled={disabled}\n autoComplete={autoComplete}\n aria-invalid={Boolean(visibleError)}\n aria-describedby={describedBy}\n className={['inconel-input', inputClassName ?? ''].join(' ')}\n onChange={(event) => handleChange(event.target.value)}\n onFocus={(event) => {\n if (disabled) return\n setFocused(true)\n const editValue = type === 'phone' && mask\n ? applyInputMask(currentValue, mask)\n : isFormattedInputType(type)\n ? String(currentValue ?? '').replace('.', getInputSeparators(locale).decimal)\n : String(currentValue ?? '')\n setEditingValue(editValue)\n onFocus?.(buildPayload(currentValue, 'focus'), event)\n }}\n onBlur={(event) => {\n setFocused(false)\n if (debounceRef.current) clearTimeout(debounceRef.current)\n let rawValue = normalize(editingValue)\n if (typeof rawValue === 'number') {\n rawValue = roundInputNumber(rawValue, decimalScale, roundOnBlur ? roundMode : 'floor')\n }\n setValidationError(validate(rawValue))\n const payload = buildPayload(rawValue, 'blur')\n emitChange(payload, true)\n onBlur?.(payload, event)\n }}\n onKeyDown={(event) => {\n if (!allowNegative && (event.key === '-' || event.key === 'Subtract')) event.preventDefault()\n onKeyDown?.(buildPayload(currentValue, 'keydown', event.key), event)\n }}\n onMouseEnter={(event) => onMouseEnter?.(buildPayload(currentValue, 'mouseenter'), event)}\n onMouseLeave={(event) => onMouseLeave?.(buildPayload(currentValue, 'mouseleave'), event)}\n />\n {isClearable && !disabled && formattedValue && clearButtonLabel && (\n <button\n type=\"button\"\n className=\"inconel-input-clear\"\n aria-label={clearButtonLabel}\n onClick={() => {\n setEditingValue('')\n setValidationError(validate(null))\n emitChange(buildPayload(null, 'clear'), true)\n }}\n >\n ×\n </button>\n )}\n {endAdornment && <span className=\"inconel-input-adornment\" aria-hidden=\"true\">{endAdornment}</span>}\n </div>\n <FieldFeedback\n hint={hint}\n errorMessage={visibleError}\n hintId={hintId}\n errorId={errorId}\n />\n </div>\n )\n})\n\nexport default Input\n"],"names":["Input","forwardRef","id","label","hint","errorMessage","startAdornment","endAdornment","fullWidth","inputClassName","labelClassName","className","required","disabled","value","defaultValue","onChange","onBlur","onFocus","onKeyDown","onMouseEnter","onMouseLeave","type","locale","currency","decimalScale","roundMode","roundOnBlur","min","max","allowNegative","debounceMs","validateOnSubmit","validationMessages","mask","limit","isClearable","readOnly","clearButtonLabel","readOnlyEmptyValue","size","variant","autoComplete","ariaDescribedBy","inputProps","ref","generatedId","useId","inputId","hintId","errorId","controlled","localValue","setLocalValue","useState","currentValue","editingValue","setEditingValue","focused","setFocused","validationError","setValidationError","debounceRef","useRef","messages","visibleError","validate","candidate","validateInputValue","formattedValue","useMemo","formatInputValue","buildPayload","rawValue","eventType","char","emitChange","payload","immediate","useEffect","normalize","text","isFormattedInputType","parsed","parseInputNumber","handleChange","digits","isLengthValidatedInputType","applyInputMask","describedBy","jsx","jsxs","event","editValue","getInputSeparators","roundInputNumber","FieldFeedback"],"mappings":";;;;;;;;AAsIA,MAAMA,KAAQC,GAAyC,SACrD;AAAA,EACE,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,WAAAC,KAAY;AAAA,EACZ,aAAAC,KAAc;AAAA,EACd,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,YAAAC,IAAa;AAAA,EACb,kBAAAC,IAAmB;AAAA,EACnB,oBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC,KAAc;AAAA,EACd,UAAAC,KAAW;AAAA,EACX,kBAAA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I,CAAC9D,MAAkB8D,EAAM,QAAQ,OAAOA,EAAM,QAAQ,eAAaA,EAAM,eAAA,GAC7EzE,KAAYqD,EAAajB,GAAc,WAAWqC,EAAM,GAAG,GAAGA,CAAK;AAAA,UACrE;AAAA,UACA,cAAc,CAACA,MAAUxE,KAAeoD,EAAajB,GAAc,YAAY,GAAGqC,CAAK;AAAA,UACvF,cAAc,CAACA,MAAUvE,KAAemD,EAAajB,GAAc,YAAY,GAAGqC,CAAK;AAAA,QAAA;AAAA,MAAA;AAAA,MAExFxD,MAAe,CAACvB,KAAYwD,KAAkB/B,KAC7C,gBAAAoD;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,cAAYpD;AAAA,UACZ,SAAS,MAAM;AACb,YAAAmB,EAAgB,EAAE,GAClBI,EAAmBK,EAAS,IAAI,CAAC,GACjCU,EAAWJ,EAAa,MAAM,OAAO,GAAG,EAAI;AAAA,UAC9C;AAAA,UACD,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAIFjE,KAAgB,gBAAAmF,EAAC,QAAA,EAAK,WAAU,2BAA0B,eAAY,QAAQ,UAAAnF,EAAA,CAAa;AAAA,IAAA,GAC9F;AAAA,IACA,gBAAAmF;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,MAAA5F;AAAA,QACA,cAAc6D;AAAA,QACd,QAAAhB;AAAA,QACA,SAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type FocusEvent,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\n\nimport { useInconelAdapters } from '../../adapters'\nimport FieldFeedback from '../FieldFeedback/FieldFeedback'\nimport type { FieldFeedbackContentProps } from '../FieldFeedback/FieldFeedback'\nimport '../shared/field.css'\nimport '../shared/field-controls.css'\nimport '../shared/sizes.css'\nimport type { ControlSize } from '../shared/types'\nimport './styles.css'\nimport {\n applyInputMask,\n formatInputValue,\n getInputSeparators,\n isFormattedInputType,\n isLengthValidatedInputType,\n parseInputNumber,\n roundInputNumber,\n validateInputValue,\n} from './utils'\n\nexport type InputType =\n | 'text'\n | 'number'\n | 'currency'\n | 'percent'\n | 'phone'\n | 'email'\n | 'password'\n\nexport type InputRoundMode = 'ceil' | 'floor' | 'round'\nexport type InputValue = string | number | null\nexport type InputEventType =\n | 'change'\n | 'blur'\n | 'focus'\n | 'keydown'\n | 'mouseenter'\n | 'mouseleave'\n | 'clear'\n\nexport interface InputPayload {\n rawValue: InputValue\n formattedValue: string\n error: boolean\n char: string | null\n eventType: InputEventType\n}\n\nexport interface InputValidationMessages {\n required?: string\n invalidNumber?: string\n minNumber?: string\n maxNumber?: string\n minLength?: string\n maxLength?: string\n invalidPhone?: string\n invalidEmail?: string\n}\n\ntype NativeInputProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n | 'type'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'onBlur'\n | 'onFocus'\n | 'onKeyDown'\n | 'onMouseEnter'\n | 'onMouseLeave'\n | 'min'\n | 'max'\n | 'size'\n | 'readOnly'\n>\n\nexport interface InputProps extends NativeInputProps, FieldFeedbackContentProps {\n label?: string\n startAdornment?: ReactNode\n endAdornment?: ReactNode\n fullWidth?: boolean\n inputClassName?: string\n labelClassName?: string\n value?: InputValue\n defaultValue?: InputValue\n onChange?: (payload: InputPayload) => void\n onBlur?: (payload: InputPayload, event: FocusEvent<HTMLInputElement>) => void\n onFocus?: (payload: InputPayload, event: FocusEvent<HTMLInputElement>) => void\n onKeyDown?: (\n payload: InputPayload,\n event: KeyboardEvent<HTMLInputElement>,\n ) => void\n onMouseEnter?: (\n payload: InputPayload,\n event: MouseEvent<HTMLInputElement>,\n ) => void\n onMouseLeave?: (\n payload: InputPayload,\n event: MouseEvent<HTMLInputElement>,\n ) => void\n type?: InputType\n locale?: string\n currency?: string\n decimalScale?: number\n roundMode?: InputRoundMode\n roundOnBlur?: boolean\n min?: number\n max?: number\n allowNegative?: boolean\n debounceMs?: number\n validateOnSubmit?: boolean\n validationMessages?: InputValidationMessages\n mask?: string\n limit?: number\n isClearable?: boolean\n readOnly?: boolean\n clearButtonLabel?: string\n readOnlyEmptyValue?: ReactNode\n size?: ControlSize\n variant?: 'outlined' | 'plain'\n}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n id,\n label,\n hint,\n errorMessage,\n startAdornment,\n endAdornment,\n fullWidth = false,\n inputClassName,\n labelClassName,\n className,\n required,\n disabled,\n value,\n defaultValue = '',\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n onMouseEnter,\n onMouseLeave,\n type = 'text',\n locale = 'tr-TR',\n currency = 'TRY',\n decimalScale = 0,\n roundMode = 'floor',\n roundOnBlur = false,\n min,\n max,\n allowNegative = false,\n debounceMs = 0,\n validateOnSubmit = false,\n validationMessages,\n mask,\n limit,\n isClearable = false,\n readOnly = false,\n clearButtonLabel,\n readOnlyEmptyValue = null,\n size = 'md',\n variant = 'outlined',\n autoComplete = 'off',\n 'aria-describedby': ariaDescribedBy,\n ...inputProps\n },\n ref,\n) {\n const adapters = useInconelAdapters()\n const resolvedClearButtonLabel =\n clearButtonLabel ??\n String(adapters.translate?.('clear', 'Temizle') ?? 'Temizle')\n\n const generatedId = useId()\n const inputId = id ?? `inconel-input-${generatedId.replace(/:/g, '')}`\n const hintId = `${inputId}-hint`\n const errorId = `${inputId}-error`\n const controlled = value !== undefined\n const [localValue, setLocalValue] = useState<InputValue>(defaultValue)\n const currentValue = controlled ? value : localValue\n const [editingValue, setEditingValue] = useState('')\n const [focused, setFocused] = useState(false)\n const [validationError, setValidationError] = useState<string | null>(null)\n const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const messages = validationMessages ?? {}\n const visibleError = errorMessage ?? validationError\n\n const validate = (candidate: InputValue) =>\n validateInputValue(candidate, {\n required: Boolean(required),\n type,\n min,\n max,\n mask,\n messages,\n })\n\n const formattedValue = useMemo(\n () =>\n formatInputValue(\n currentValue,\n type,\n locale,\n decimalScale,\n currency,\n mask,\n ),\n [currentValue, currency, decimalScale, locale, mask, type],\n )\n\n const buildPayload = (\n rawValue: InputValue,\n eventType: InputEventType,\n char: string | null = null,\n ): InputPayload => ({\n rawValue,\n formattedValue: formatInputValue(\n rawValue,\n type,\n locale,\n decimalScale,\n currency,\n mask,\n ),\n error: Boolean(validate(rawValue)),\n char,\n eventType,\n })\n\n const emitChange = (payload: InputPayload, immediate = false) => {\n if (!controlled) setLocalValue(payload.rawValue)\n if (debounceRef.current) clearTimeout(debounceRef.current)\n if (!onChange) return\n if (immediate || debounceMs <= 0) onChange(payload)\n else debounceRef.current = setTimeout(() => onChange(payload), debounceMs)\n }\n\n useEffect(() => () => {\n if (debounceRef.current) clearTimeout(debounceRef.current)\n }, [])\n\n useEffect(() => {\n if (validateOnSubmit) setValidationError(validate(currentValue))\n // Validation intentionally runs when submit state changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [validateOnSubmit])\n\n const normalize = (text: string): InputValue => {\n if (type === 'phone' && mask) return text.replace(/\\D/g, '')\n if (isFormattedInputType(type)) {\n const parsed = parseInputNumber(text, locale)\n if (parsed === null) return text === '' ? null : text\n return allowNegative ? parsed : Math.abs(parsed)\n }\n return text\n }\n\n const handleChange = (text: string) => {\n const digits = text.replace(/\\D/g, '')\n if (\n limit &&\n (isFormattedInputType(type) || type === 'phone') &&\n digits.length > limit\n ) return\n if (limit && isLengthValidatedInputType(type) && text.length > limit) return\n const rawValue = normalize(text)\n if (typeof rawValue === 'number') {\n if (typeof min === 'number' && rawValue < min) return\n if (typeof max === 'number' && rawValue > max) return\n }\n setEditingValue(\n type === 'phone' && mask ? applyInputMask(rawValue, mask) : text,\n )\n emitChange(buildPayload(rawValue, 'change', text.slice(-1) || null))\n }\n\n const describedBy = [\n ariaDescribedBy,\n hint && !visibleError ? hintId : undefined,\n visibleError ? errorId : undefined,\n ].filter(Boolean).join(' ') || undefined\n\n if (readOnly) {\n return (\n <div className={['inconel-field', `inconel-size-${size}`, fullWidth ? 'inconel-field--full-width' : '', className ?? ''].join(' ')}>\n {label && <span className={['inconel-field__label', labelClassName ?? ''].join(' ')}>{label}</span>}\n <div className=\"inconel-input-readonly\" aria-label={label}>\n {formattedValue || readOnlyEmptyValue}\n </div>\n </div>\n )\n }\n\n return (\n <div className={['inconel-field', `inconel-size-${size}`, fullWidth ? 'inconel-field--full-width' : '', className ?? ''].join(' ')}>\n {label && (\n <label className={['inconel-field__label', labelClassName ?? ''].join(' ')} htmlFor={inputId}>\n {label}{required && <span className=\"inconel-field__required\" aria-hidden=\"true\"> *</span>}\n </label>\n )}\n <div className={['inconel-input-control', variant === 'plain' ? 'inconel-input-control--plain' : '', visibleError ? 'inconel-is-invalid' : '', disabled ? 'inconel-is-disabled' : ''].join(' ')}>\n {startAdornment && <span className=\"inconel-input-adornment\" aria-hidden=\"true\">{startAdornment}</span>}\n <input\n {...inputProps}\n ref={ref}\n id={inputId}\n type={type === 'password' || type === 'email' ? type : 'text'}\n inputMode={isFormattedInputType(type) ? 'decimal' : type === 'phone' ? 'tel' : undefined}\n value={focused ? editingValue : formattedValue}\n required={required}\n disabled={disabled}\n autoComplete={autoComplete}\n aria-invalid={Boolean(visibleError)}\n aria-describedby={describedBy}\n className={['inconel-input', inputClassName ?? ''].join(' ')}\n onChange={(event) => handleChange(event.target.value)}\n onFocus={(event) => {\n if (disabled) return\n setFocused(true)\n const editValue = type === 'phone' && mask\n ? applyInputMask(currentValue, mask)\n : isFormattedInputType(type)\n ? String(currentValue ?? '').replace('.', getInputSeparators(locale).decimal)\n : String(currentValue ?? '')\n setEditingValue(editValue)\n onFocus?.(buildPayload(currentValue, 'focus'), event)\n }}\n onBlur={(event) => {\n setFocused(false)\n if (debounceRef.current) clearTimeout(debounceRef.current)\n let rawValue = normalize(editingValue)\n if (typeof rawValue === 'number') {\n rawValue = roundInputNumber(rawValue, decimalScale, roundOnBlur ? roundMode : 'floor')\n }\n setValidationError(validate(rawValue))\n const payload = buildPayload(rawValue, 'blur')\n emitChange(payload, true)\n onBlur?.(payload, event)\n }}\n onKeyDown={(event) => {\n if (!allowNegative && (event.key === '-' || event.key === 'Subtract')) event.preventDefault()\n onKeyDown?.(buildPayload(currentValue, 'keydown', event.key), event)\n }}\n onMouseEnter={(event) => onMouseEnter?.(buildPayload(currentValue, 'mouseenter'), event)}\n onMouseLeave={(event) => onMouseLeave?.(buildPayload(currentValue, 'mouseleave'), event)}\n />\n {isClearable && !disabled && formattedValue && (\n <button\n type=\"button\"\n className=\"inconel-input-clear\"\n aria-label={resolvedClearButtonLabel}\n onClick={() => {\n setEditingValue('')\n setValidationError(validate(null))\n emitChange(buildPayload(null, 'clear'), true)\n }}\n >\n ×\n </button>\n )}\n {endAdornment && <span className=\"inconel-input-adornment\" aria-hidden=\"true\">{endAdornment}</span>}\n </div>\n <FieldFeedback\n hint={hint}\n errorMessage={visibleError}\n hintId={hintId}\n errorId={errorId}\n />\n </div>\n )\n})\n\nexport default Input\n"],"names":["Input","forwardRef","id","label","hint","errorMessage","startAdornment","endAdornment","fullWidth","inputClassName","labelClassName","className","required","disabled","value","defaultValue","onChange","onBlur","onFocus","onKeyDown","onMouseEnter","onMouseLeave","type","locale","currency","decimalScale","roundMode","roundOnBlur","min","max","allowNegative","debounceMs","validateOnSubmit","validationMessages","mask","limit","isClearable","readOnly","clearButtonLabel","readOnlyEmptyValue","size","variant","autoComplete","ariaDescribedBy","inputProps","ref","adapters","useInconelAdapters","resolvedClearButtonLabel","generatedId","useId","inputId","hintId","errorId","controlled","localValue","setLocalValue","useState","currentValue","editingValue","setEditingValue","focused","setFocused","validationError","setValidationError","debounceRef","useRef","messages","visibleError","validate","candidate","validateInputValue","formattedValue","useMemo","formatInputValue","buildPayload","rawValue","eventType","char","emitChange","payload","immediate","useEffect","normalize","text","isFormattedInputType","parsed","parseInputNumber","handleChange","digits","isLengthValidatedInputType","applyInputMask","describedBy","jsx","jsxs","event","editValue","getInputSeparators","roundInputNumber","FieldFeedback"],"mappings":";;;;;;;;;AAuIA,MAAMA,KAAQC,GAAyC,SACrD;AAAA,EACE,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,WAAAC,KAAY;AAAA,EACZ,aAAAC,KAAc;AAAA,EACd,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,YAAAC,IAAa;AAAA,EACb,kBAAAC,IAAmB;AAAA,EACnB,oBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC,KAAc;AAAA,EACd,UAAAC,KAAW;AAAA,EACX,kBAAAC;AAAA,EACA,oBAAAC,KAAqB;AAAA,EACrB,MAAAC,IAAO;AAAA,EACP,SAAAC,KAAU;AAAA,EACV,cAAAC,KAAe;AAAA,EACf,oBAAoBC;AAAA,EACpB,GAAGC;AACL,GACAC,IACA;AACA,QAAMC,KAAWC,GAAA,GACXC,KACJV,MACA,OAAOQ,GAAS,YAAY,SAAS,SAAS,KAAK,SAAS,GAExDG,KAAcC,GAAA,GACdC,IAAUjD,KAAM,iBAAi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GqC,CAAK;AAAA,UACvF,cAAc,CAACA,MAAU1E,KAAesD,EAAajB,GAAc,YAAY,GAAGqC,CAAK;AAAA,QAAA;AAAA,MAAA;AAAA,MAExF3D,MAAe,CAACvB,KAAY2D,KAC3B,gBAAAqB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,cAAY7C;AAAA,UACZ,SAAS,MAAM;AACb,YAAAY,EAAgB,EAAE,GAClBI,EAAmBK,EAAS,IAAI,CAAC,GACjCU,EAAWJ,EAAa,MAAM,OAAO,GAAG,EAAI;AAAA,UAC9C;AAAA,UACD,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAIFpE,KAAgB,gBAAAsF,EAAC,QAAA,EAAK,WAAU,2BAA0B,eAAY,QAAQ,UAAAtF,EAAA,CAAa;AAAA,IAAA,GAC9F;AAAA,IACA,gBAAAsF;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,MAAA/F;AAAA,QACA,cAAcgE;AAAA,QACd,QAAAhB;AAAA,QACA,SAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inconel",
3
- "version": "0.1.18",
3
+ "version": "0.1.21",
4
4
  "description": "Accessible, type-safe React UI components for modern applications.",
5
5
  "keywords": [
6
6
  "react",