inconel 0.1.11 → 0.1.12

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.
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),t=require("../shared/classNames.cjs");;/* empty css */function l({text:e,variant:n="primary",size:a="md",className:r,children:s,...i}){return c.jsx("span",{...i,className:t.classNames("inconel-badge",`inconel-badge--${n}`,`inconel-badge--${a}`,r),children:e??s})}exports.Badge=l;
2
+ //# sourceMappingURL=Badge.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.cjs","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\n\nimport { classNames } from '../shared/classNames'\nimport type { ControlSize } from '../shared/types'\nimport './styles.css'\n\nexport type BadgeVariant =\n | 'primary'\n | 'secondary'\n | 'dark'\n | 'warning'\n | 'danger'\n | 'success'\n | 'light'\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n text?: ReactNode\n variant?: BadgeVariant\n size?: ControlSize\n}\n\nexport function Badge({\n text,\n variant = 'primary',\n size = 'md',\n className,\n children,\n ...props\n}: BadgeProps) {\n return (\n <span\n {...props}\n className={classNames(\n 'inconel-badge',\n `inconel-badge--${variant}`,\n `inconel-badge--${size}`,\n className,\n )}\n >\n {text ?? children}\n </span>\n )\n}\n"],"names":["Badge","text","variant","size","className","children","props","jsx","classNames"],"mappings":"uLAqBO,SAASA,EAAM,CACpB,KAAAC,EACA,QAAAC,EAAU,UACV,KAAAC,EAAO,KACP,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAe,CACb,OACEC,EAAAA,IAAC,OAAA,CACE,GAAGD,EACJ,UAAWE,EAAAA,WACT,gBACA,kBAAkBN,CAAO,GACzB,kBAAkBC,CAAI,GACtBC,CAAA,EAGD,SAAAH,GAAQI,CAAA,CAAA,CAGf"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),l=require("react"),be=require("../FieldFeedback/FieldFeedback.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */const i=require("./utils.cjs"),ve=l.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:ue=null,size:P="md",autoComplete:le="off","aria-describedby":se,...ae},ce){const de=l.useId(),I=J??`inconel-input-${de.replace(/:/g,"")}`,C=`${I}-hint`,K=`${I}-error`,Y=B!==void 0,[fe,pe]=l.useState(U),t=Y?B:fe,[k,F]=l.useState(""),[he,G]=l.useState(!1),[je,M]=l.useState(null),a=l.useRef(null),me=ie??{},p=O??je,g=e=>i.validateInputValue(e,{required:!!b,type:n,min:T,max:N,mask:s,messages:me}),q=l.useMemo(()=>i.formatInputValue(t,n,f,j,V,s),[t,V,j,f,s,n]),c=(e,r,u=null)=>({rawValue:e,formattedValue:i.formatInputValue(e,n,f,j,V,s),error:!!g(e),char:u,eventType:r}),_=(e,r=!1)=>{Y||pe(e.rawValue),a.current&&clearTimeout(a.current),v&&(r||D<=0?v(e):a.current=setTimeout(()=>v(e),D))};l.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),l.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},Ie=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 u=H(e);typeof u=="number"&&(typeof T=="number"&&u<T||typeof N=="number"&&u>N)||(F(n==="phone"&&s?i.applyInputMask(u,s):e),_(c(u,"change",e.slice(-1)||null)))},ge=[se,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||ue})]}):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",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",{...ae,ref:ce,id:I,type:n==="password"||n==="email"?n:"text",inputMode:i.isFormattedInputType(n)?"decimal":n==="phone"?"tel":void 0,value:he?k:q,required:b,disabled:h,autoComplete:le,"aria-invalid":!!p,"aria-describedby":ge,className:["inconel-input",Q??""].join(" "),onChange:e=>Ie(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 u=c(r,"blur");_(u,!0),X?.(u,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(be.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 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;
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}\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 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', 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","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":"kYAqIMA,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,EAC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AA,EAC7ExE,IAAYoD,EAAajB,EAAc,UAAWqC,EAAM,GAAG,EAAGA,CAAK,CACrE,EACA,aAAeA,GAAUvE,IAAemD,EAAajB,EAAc,YAAY,EAAGqC,CAAK,EACvF,aAAeA,GAAUtE,KAAekD,EAAajB,EAAc,YAAY,EAAGqC,CAAK,CAAA,CAAA,EAExFvD,IAAe,CAACvB,GAAYuD,GAAkB9B,GAC7CmD,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,sBACV,aAAYnD,EACZ,QAAS,IAAM,CACbkB,EAAgB,EAAE,EAClBI,EAAmBK,EAAS,IAAI,CAAC,EACjCU,EAAWJ,EAAa,KAAM,OAAO,EAAG,EAAI,CAC9C,EACD,SAAA,GAAA,CAAA,EAIFhE,GAAgBkF,EAAAA,IAAC,OAAA,CAAK,UAAU,0BAA0B,cAAY,OAAQ,SAAAlF,CAAA,CAAa,CAAA,EAC9F,EACAkF,EAAAA,IAACM,GAAAA,QAAA,CACC,KAAA3F,EACA,aAAc4D,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 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,QAAA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C,EAAM,GAAG,EAAGA,CAAK,CACrE,EACA,aAAeA,GAAUxE,IAAeoD,EAAajB,EAAc,YAAY,EAAGqC,CAAK,EACvF,aAAeA,GAAUvE,KAAemD,EAAajB,EAAc,YAAY,EAAGqC,CAAK,CAAA,CAAA,EAExFxD,IAAe,CAACvB,GAAYwD,GAAkB/B,GAC7CoD,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,sBACV,aAAYpD,EACZ,QAAS,IAAM,CACbmB,EAAgB,EAAE,EAClBI,EAAmBK,EAAS,IAAI,CAAC,EACjCU,EAAWJ,EAAa,KAAM,OAAO,EAAG,EAAI,CAC9C,EACD,SAAA,GAAA,CAAA,EAIFjE,GAAgBmF,EAAAA,IAAC,OAAA,CAAK,UAAU,0BAA0B,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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const e=require("./components/FieldFeedback/FieldFeedback.cjs"),t=require("./components/Input/Input.cjs"),r=require("./components/Select/Select.cjs"),o=require("./components/Svg/Svg.cjs"),i=require("./components/Textarea/Textarea.cjs"),c=require("./components/Button/Button.cjs"),n=require("./components/Checkbox/Checkbox.cjs"),u=require("./components/CheckboxGroup/CheckboxGroup.cjs"),l=require("./components/CurrencyInput/CurrencyInput.cjs"),a=require("./components/CustomizableSwitch/CustomizableSwitch.cjs"),d=require("./components/DataGrid/DataGrid.cjs"),s=require("./components/DatePicker/DatePicker.cjs"),p=require("./components/DndFileUpload/DndFileUpload.cjs"),q=require("./components/DotLoader/DotLoader.cjs"),T=require("./components/DragDropUpload/DragDropUpload.cjs"),b=require("./components/ExcelTable/ExcelTable.cjs"),x=require("./components/FileUpload/FileUpload.cjs"),S=require("./components/FileUploadText/FileUploadText.cjs"),h=require("./components/Filter/Filter.cjs"),I=require("./components/HTMLTable/HTMLTable.cjs"),D=require("./components/HtmlEditor/HtmlEditor.cjs"),k=require("./adapters/InconelProvider.cjs"),F=require("./components/InputText/InputText.cjs"),M=require("./components/Loader/Loader.cjs"),C=require("./components/LoaderMini/LoaderMini.cjs"),L=require("./components/Modal/Modal.cjs"),U=require("./components/MultiSelect/MultiSelect.cjs"),O=require("./components/MultiSelectWithCheckbox/MultiSelectWithCheckbox.cjs"),E=require("./components/Option/Option.cjs"),G=require("./components/OptionWithIcon/OptionWithIcon.cjs"),y=require("./components/RadioGroup/RadioGroup.cjs"),g=require("./components/ReadOnly/ReadOnly.cjs"),m=require("./components/SlideTabs/SlideTabs.cjs"),P=require("./components/SocketStatus/SocketStatus.cjs"),f=require("./components/Switch/Switch.cjs"),v=require("./components/Table/Table.cjs"),w=require("./components/Tabs/Tabs.cjs"),H=require("./components/TextEditor/TextEditor.cjs"),R=require("./components/TextInput/TextInput.cjs"),W=require("./components/Tooltip/Tooltip.cjs"),z=require("./adapters/context.cjs");exports.FieldFeedback=e.default;exports.Input=t.default;exports.Select=r.default;exports.Svg=o.default;exports.Textarea=i.default;exports.Button=c.Button;exports.Checkbox=n.Checkbox;exports.CheckboxGroup=u.CheckboxGroup;exports.CurrencyInput=l.CurrencyInput;exports.CustomizableSwitch=a.CustomizableSwitch;exports.DataGrid=d.DataGrid;exports.DatePicker=s.DatePicker;exports.DndFileUpload=p.DndFileUpload;exports.DotLoader=q.DotLoader;exports.DragDropUpload=T.DragDropUpload;exports.ExcelTable=b.ExcelTable;exports.FileUpload=x.FileUpload;exports.FileUploadText=S.FileUploadText;exports.Filter=h.Filter;exports.HTMLTable=I.HTMLTable;exports.HtmlEditor=D.HtmlEditor;exports.InconelProvider=k.InconelProvider;exports.InputText=F.InputText;exports.Loader=M.Loader;exports.LoaderMini=C.LoaderMini;exports.Modal=L.Modal;exports.MultiSelect=U.MultiSelect;exports.MultiSelectWithCheckbox=O.MultiSelectWithCheckbox;exports.Option=E.Option;exports.OptionWithIcon=G.OptionWithIcon;exports.RadioGroup=y.RadioGroup;exports.ReadOnly=g.ReadOnly;exports.SlideTabs=m.SlideTabs;exports.SocketStatus=P.SocketStatus;exports.Switch=f.Switch;exports.Table=v.Table;exports.Tabs=w.Tabs;exports.TextEditor=H.TextEditor;exports.TextInput=R.TextInput;exports.Tooltip=W.Tooltip;exports.useInconelAdapters=z.useInconelAdapters;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const e=require("./components/FieldFeedback/FieldFeedback.cjs"),t=require("./components/Input/Input.cjs"),r=require("./components/Select/Select.cjs"),o=require("./components/Svg/Svg.cjs"),i=require("./components/Textarea/Textarea.cjs"),c=require("./components/Badge/Badge.cjs"),n=require("./components/Button/Button.cjs"),u=require("./components/Checkbox/Checkbox.cjs"),l=require("./components/CheckboxGroup/CheckboxGroup.cjs"),a=require("./components/CurrencyInput/CurrencyInput.cjs"),d=require("./components/CustomizableSwitch/CustomizableSwitch.cjs"),s=require("./components/DataGrid/DataGrid.cjs"),p=require("./components/DatePicker/DatePicker.cjs"),q=require("./components/DndFileUpload/DndFileUpload.cjs"),T=require("./components/DotLoader/DotLoader.cjs"),b=require("./components/DragDropUpload/DragDropUpload.cjs"),x=require("./components/ExcelTable/ExcelTable.cjs"),S=require("./components/FileUpload/FileUpload.cjs"),h=require("./components/FileUploadText/FileUploadText.cjs"),I=require("./components/Filter/Filter.cjs"),D=require("./components/HTMLTable/HTMLTable.cjs"),k=require("./components/HtmlEditor/HtmlEditor.cjs"),F=require("./adapters/InconelProvider.cjs"),M=require("./components/InputText/InputText.cjs"),C=require("./components/Loader/Loader.cjs"),L=require("./components/LoaderMini/LoaderMini.cjs"),U=require("./components/Modal/Modal.cjs"),g=require("./components/MultiSelect/MultiSelect.cjs"),O=require("./components/MultiSelectWithCheckbox/MultiSelectWithCheckbox.cjs"),E=require("./components/Option/Option.cjs"),G=require("./components/OptionWithIcon/OptionWithIcon.cjs"),y=require("./components/RadioGroup/RadioGroup.cjs"),m=require("./components/ReadOnly/ReadOnly.cjs"),P=require("./components/SlideTabs/SlideTabs.cjs"),f=require("./components/SocketStatus/SocketStatus.cjs"),v=require("./components/Switch/Switch.cjs"),w=require("./components/Table/Table.cjs"),B=require("./components/Tabs/Tabs.cjs"),H=require("./components/TextEditor/TextEditor.cjs"),R=require("./components/TextInput/TextInput.cjs"),W=require("./components/Tooltip/Tooltip.cjs"),z=require("./adapters/context.cjs");exports.FieldFeedback=e.default;exports.Input=t.default;exports.Select=r.default;exports.Svg=o.default;exports.Textarea=i.default;exports.Badge=c.Badge;exports.Button=n.Button;exports.Checkbox=u.Checkbox;exports.CheckboxGroup=l.CheckboxGroup;exports.CurrencyInput=a.CurrencyInput;exports.CustomizableSwitch=d.CustomizableSwitch;exports.DataGrid=s.DataGrid;exports.DatePicker=p.DatePicker;exports.DndFileUpload=q.DndFileUpload;exports.DotLoader=T.DotLoader;exports.DragDropUpload=b.DragDropUpload;exports.ExcelTable=x.ExcelTable;exports.FileUpload=S.FileUpload;exports.FileUploadText=h.FileUploadText;exports.Filter=I.Filter;exports.HTMLTable=D.HTMLTable;exports.HtmlEditor=k.HtmlEditor;exports.InconelProvider=F.InconelProvider;exports.InputText=M.InputText;exports.Loader=C.Loader;exports.LoaderMini=L.LoaderMini;exports.Modal=U.Modal;exports.MultiSelect=g.MultiSelect;exports.MultiSelectWithCheckbox=O.MultiSelectWithCheckbox;exports.Option=E.Option;exports.OptionWithIcon=G.OptionWithIcon;exports.RadioGroup=y.RadioGroup;exports.ReadOnly=m.ReadOnly;exports.SlideTabs=P.SlideTabs;exports.SocketStatus=f.SocketStatus;exports.Switch=v.Switch;exports.Table=w.Table;exports.Tabs=B.Tabs;exports.TextEditor=H.TextEditor;exports.TextInput=R.TextInput;exports.Tooltip=W.Tooltip;exports.useInconelAdapters=z.useInconelAdapters;
2
2
  //# sourceMappingURL=index.cjs.map