@epam/ai-dial-ui-kit 0.2.0-rc.10 → 0.2.0-rc.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("classnames"),b=require("@tabler/icons-react"),p=require("react"),x=require("@floating-ui/react"),N=({icon:e,className:s})=>e?r.jsx("span",{className:d("flex-shrink-0",s),children:e}):null;var k=(e=>(e.Primary="primary",e.Secondary="secondary",e.Tertiary="tertiary",e))(k||{});const $={[k.Primary]:"dial-primary-button",[k.Secondary]:"dial-secondary-button",[k.Tertiary]:"dial-tertiary-button"},V=({title:e,variant:s,cssClass:t,ref:n,onClick:a,disable:o,iconAfter:l,iconBefore:i,hideTitleOnMobile:c,ariaLabel:m})=>{const u=d("dial-small-semi",l?"mr-2":"",i?"ml-2":"",c?"hidden sm:inline":"inline"),h=d(s&&$[s],t,"focus-visible:outline outline-offset-0");return r.jsxs("button",{ref:n,type:"button",className:h,onClick:v=>a?.(v),disabled:o,"aria-label":e||m,children:[r.jsx(N,{icon:i}),e&&r.jsx("span",{className:u,children:e}),r.jsx(N,{icon:l})]})},S=({errorText:e})=>e&&r.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),A=({fieldTitle:e,htmlFor:s,optional:t,optionalText:n,cssClass:a})=>e?r.jsxs("label",{className:d("dial-tiny text-secondary",a,!a?.includes("mb")&&"mb-2"),htmlFor:s,children:[r.jsx("span",{className:"min-h-4",children:e}),t&&r.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null;var C=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(C||{});const K={info:r.jsx(b.IconInfoCircle,{size:24,stroke:2}),error:r.jsx(b.IconAlertCircle,{size:24,stroke:2}),warning:r.jsx(b.IconAlertTriangle,{size:24,stroke:2}),success:r.jsx(b.IconCircleCheck,{size:24,stroke:2})},G={[C.Info]:"bg-info border-info text-info",[C.Success]:"bg-success border-success text-success",[C.Warning]:"bg-warning border-warning text-warning",[C.Error]:"bg-error border-error text-error"},Z="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",X=({variant:e=C.Info,message:s,cssClass:t,closable:n=!1,onClose:a})=>r.jsxs("div",{role:"alert",className:d(Z,G[e],t),children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(N,{icon:K[e]}),r.jsx("div",{className:"text-primary",children:s})]}),n&&r.jsx(V,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:r.jsx(b.IconX,{size:16}),onClick:o=>a?.(o)})]}),Y="flex items-center justify-center text-secondary",J="shrink-0 grow-0 basis-auto animate-spin-steps",Q=({size:e=18,cssClass:s,iconClass:t,fullWidth:n=!0,ariaLabel:a="Loading"})=>r.jsx("div",{role:"status","aria-label":a,className:d({[Y]:!0,"w-full h-full":n,[s||""]:!!s}),children:r.jsx(N,{icon:r.jsx(b.IconLoader,{width:e,height:e,className:d(J,t)})})}),ee=7,re=2,z=p.createContext(null),M=()=>{const e=p.useContext(z);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},se=({initialOpen:e=!1,placement:s="bottom",isTriggerClickable:t=!1,open:n,onOpenChange:a}={})=>{const[o,l]=p.useState(e),i=p.useRef(null),c=n??o,m=a??l,u=x.useFloating({placement:s,open:c,onOpenChange:m,whileElementsMounted:x.autoUpdate,middleware:[x.offset(ee+re),x.flip({crossAxis:s.includes("-"),fallbackAxisSideDirection:"start",padding:5}),x.shift({padding:5}),x.arrow({element:i})]}),h=x.useHover(u.context,{move:!1,enabled:n==null,mouseOnly:t,delay:{open:500,close:0}}),v=x.useFocus(u.context,{enabled:n==null}),F=x.useDismiss(u.context),j=x.useRole(u.context,{role:"tooltip"}),g=x.useInteractions([h,v,F,j]);return p.useMemo(()=>({open:c,setOpen:m,arrowRef:i,...g,...u}),[c,m,g,u])},te=({children:e,...s})=>{const t=se(s);return r.jsx(z.Provider,{value:t,children:e})},ne=p.forwardRef(function({style:s,...t},n){const a=M(),o=x.useMergeRefs([a.refs.setFloating,n]);return a.open?r.jsx(x.FloatingPortal,{id:"tooltip-portal",children:r.jsxs("div",{ref:o,style:{...a.floatingStyles,...s},...a.getFloatingProps(t),className:d("z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",a.getFloatingProps(t).className),children:[t.children,r.jsx(x.FloatingArrow,{ref:a.arrowRef,context:a.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),ae=p.forwardRef(function({children:s,asChild:t=!1,...n},a){const o=M(),i=s&&typeof s=="object"&&"ref"in s&&s.ref!==void 0?s.ref:void 0,c=x.useMergeRefs([o.refs.setReference,a,i]);return t&&p.isValidElement(s)?p.cloneElement(s,o.getReferenceProps({ref:c,...n,...s.props})):r.jsx("span",{ref:c,...o.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:s})}),w=({hideTooltip:e,tooltip:s,children:t,triggerClassName:n,contentClassName:a,...o})=>e||!s?r.jsx("span",{className:n,children:t}):r.jsxs(te,{...o,children:[r.jsx(ae,{className:d(n,"truncate"),children:t}),r.jsx(ne,{className:d("text-primary",a,"max-w-[300px]",(e||!s)&&"hidden"),children:s})]}),oe=18,O={size:oe,stroke:2},le=({label:e,id:s,checked:t,indeterminate:n,disabled:a,ariaLabel:o,onChange:l})=>{const i=p.useCallback(u=>{u.stopPropagation(),l?.(u.target.checked,s)},[l,s]),c=d("flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",`${t?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":""),m=d("mr-2 border rounded",a?"bg-layer-4 border-icon-secondary":"");return r.jsxs("label",{className:c,htmlFor:s,children:[t&&(n?r.jsx(b.IconMinus,{className:m,...O}):r.jsx(b.IconCheck,{className:m,...O})),e&&r.jsx(w,{tooltip:e,triggerClassName:"flex-1 min-w-0",children:r.jsx("p",{className:"text-primary w-full truncate",children:e})}),r.jsx("input",{type:"checkbox",onChange:i,id:s,checked:t,"aria-checked":n?"mixed":t,"aria-disabled":a||void 0,"aria-label":e?void 0:o,className:"invisible w-0 h-0"})]})};var f=(e=>(e.VALID="valid",e.ERROR="error",e))(f||{});const ie=(e,s)=>{if(s===e.id)switch(e.status){case f.VALID:return"border-accent-secondary text-primary";case f.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case f.VALID:return"border-primary text-white";case f.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},ce=(e,s)=>{if(s===e.id)switch(e.status){case f.VALID:return"bg-accent-secondary";case f.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case f.VALID:return"bg-accent-secondary";case f.ERROR:return"bg-red-400";default:return"bg-layer-4"}},de=({step:e,index:s,currentStep:t,handleStepChange:n})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",l=()=>t===e.id&&e.status===f.ERROR?r.jsx(b.IconExclamationCircle,{stroke:2,size:16}):t!==e.id&&e.status===f.VALID?r.jsx(b.IconCheck,{stroke:2,size:16}):s+1;return r.jsxs("button",{className:d(a,ie(e,t)),onClick:()=>n(e.id),children:[r.jsx("span",{className:d(o,ce(e,t)),children:l()}),r.jsx("span",{children:e.name})]})},ue=({steps:e,currentStep:s,setCurrentStep:t})=>{const n=a=>{const o=e.findIndex(i=>i.id===s),l=e.findIndex(i=>i.id===a);(a!==s&&e[o].status===f.VALID||l<o)&&t(a)};return r.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>r.jsx(de,{currentStep:s,handleStepChange:n,step:a,index:o},a.id))})},_=({value:e,textareaId:s,placeholder:t,cssClass:n="",disabled:a,invalid:o,readonly:l,onChange:i})=>r.jsx(w,{tooltip:e,triggerClassName:"flex",children:r.jsx("textarea",{id:s,placeholder:t,value:e||"",disabled:a,className:d("dial-textarea dial-input",o?"dial-input-error":"",a&&"dial-input-disable",l&&"dial-input-readonly",n),onChange:c=>!l&&i?.(c.currentTarget.value)})}),xe=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],me=(e,s,t,n)=>{if((s==="number"||t!==void 0||n!==void 0)&&!xe.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(t===void 0||t<0))&&!(e.key==="."&&s==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(t!==void 0||n!==void 0){const o=e.currentTarget.value,l=e.currentTarget.selectionStart||0,i=o.slice(0,l)+e.key+o.slice(l),c=parseFloat(i);if(!isNaN(c)){if(t!==void 0&&c<t){e.preventDefault();return}if(n!==void 0&&c>n){e.preventDefault();return}}}}},E=({iconBeforeInput:e,iconAfterInput:s,hideBorder:t,value:n,elementId:a,placeholder:o="",cssClass:l="",containerCssClass:i,tooltipTriggerClassName:c,type:m="text",disabled:u,readonly:h,invalid:v,onChange:F,min:j,max:g,prefix:P,suffix:L,textBeforeInput:D,textAfterInput:I})=>{const B=y=>y.target.blur(),q=m==="number"||j!==void 0||g!==void 0,H=y=>{me(y,m,j,g)},U=y=>{const R=y.currentTarget.value;if(q&&R!==""){const T=parseFloat(R);if(isNaN(T)&&R!=="-"&&R!=="."||!isNaN(T)&&(j!==void 0&&T<j||g!==void 0&&T>g))return}F?.(R)};return r.jsxs("div",{className:d("dial-input-field flex flex-row items-center justify-between",t?"dial-input-no-border":"dial-input",v&&"dial-input-error",u&&"dial-input-disable",h&&"dial-input-readonly",!D&&"pl-1",!I&&"pr-1",i),children:[D&&r.jsx(w,{tooltip:D,children:r.jsx(E,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"px-2 overflow-hidden overflow-ellipsis dial-small",value:D,disabled:!0,elementId:D+"textBefore"})}),P&&r.jsxs("p",{className:"text-secondary dial-small pl-2",children:[" ",P]}),r.jsx(N,{icon:e,className:"pl-2"}),r.jsx(w,{tooltip:n,triggerClassName:c,children:r.jsx("input",{type:m,autoComplete:"off",id:a,placeholder:o,value:n??"",title:n?String(n):"",disabled:u,className:d("border-0 bg-transparent px-2",l),onChange:y=>!h&&U?.(y),onKeyDown:H,onWheel:B,min:j,max:g})}),r.jsx(N,{icon:s,className:"pr-2"}),L&&r.jsxs("p",{className:"text-secondary dial-small pr-2",children:[" ",L]}),I&&r.jsx(w,{tooltip:I,children:r.jsx(E,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",cssClass:"px-2",value:I,disabled:!0,elementId:I+"textAfter"})})]})},fe=/^0+\.(\d+)?$/,pe=/^0+/,W=({fieldTitle:e,errorText:s,optional:t,elementCssClass:n,elementContainerCssClass:a,elementId:o,containerCssClass:l,readonly:i,defaultEmptyText:c,min:m,max:u,...h})=>r.jsxs("div",{className:d("flex flex-col",l),children:[r.jsx(A,{fieldTitle:e,optional:t,htmlFor:o}),i?r.jsx("span",{children:h.value||(c??"None")}):r.jsxs(r.Fragment,{children:[r.jsx(E,{elementId:o,cssClass:n,containerCssClass:a,invalid:s!=null,min:m,max:u,...h}),r.jsx(S,{errorText:s})]})]}),be=({onChange:e,value:s,min:t,max:n,...a})=>{const o=l=>String(l)?.match(fe)?String(l)?.replace(pe,"0"):Number(l);return r.jsx(W,{type:"number",onChange:l=>e?.(o(l)),value:s,min:t,max:n,...a})},he=({onChange:e,...s})=>r.jsx(W,{type:"text",onChange:t=>e?.(t),...s}),ge=({fieldTitle:e,optional:s,elementId:t,elementCssClass:n,errorText:a,...o})=>r.jsxs("div",{className:"flex flex-col",children:[r.jsx(A,{fieldTitle:e,optional:s,htmlFor:t}),r.jsx(_,{textareaId:t,cssClass:n,...o}),r.jsx(S,{errorText:a})]}),je=({title:e,switchId:s,isOn:t=!1,disabled:n,onChange:a})=>{const o=d("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",t?"flex-row-reverse":"flex-row",n?"pointer-events-none":"",n?t?"bg-controls-disable":"bg-layer-4":t?"bg-accent-primary":"bg-layer-4"),l=p.useCallback(i=>{i.stopPropagation(),a?.(!t)},[a,t]);return r.jsxs("div",{className:"flex flex-row items-center",children:[r.jsx("input",{type:"checkbox",onChange:l,id:s,disabled:n,className:"invisible w-0 h-0",checked:t}),r.jsx("label",{htmlFor:s,className:o,children:r.jsx("span",{className:d("size-3 rounded-full",n?t?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&r.jsx("span",{className:"pl-2 dial-small text-primary",children:e})]})};exports.AlertVariant=C;exports.ButtonVariant=k;exports.DialAlert=X;exports.DialButton=V;exports.DialCheckbox=le;exports.DialErrorText=S;exports.DialFieldLabel=A;exports.DialIcon=N;exports.DialInput=E;exports.DialLoader=Q;exports.DialNumberInputField=be;exports.DialSteps=ue;exports.DialSwitch=je;exports.DialTextAreaField=ge;exports.DialTextInputField=he;exports.DialTextarea=_;exports.DialTooltip=w;exports.StepStatus=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("classnames"),b=require("@tabler/icons-react"),m=require("react"),x=require("@floating-ui/react"),w=({icon:e,className:s})=>e?r.jsx("span",{className:d("flex-shrink-0",s),children:e}):null;var k=(e=>(e.Primary="primary",e.Secondary="secondary",e.Tertiary="tertiary",e))(k||{});const K={[k.Primary]:"dial-primary-button",[k.Secondary]:"dial-secondary-button",[k.Tertiary]:"dial-tertiary-button"},V=({title:e,variant:s,cssClass:t,ref:n,onClick:a,disable:o,iconAfter:l,iconBefore:i,hideTitleOnMobile:c,ariaLabel:p})=>{const u=d("dial-small-semi",l?"mr-2":"",i?"ml-2":"",c?"hidden sm:inline":"inline"),h=d(s&&K[s],t,"focus-visible:outline outline-offset-0");return r.jsxs("button",{ref:n,type:"button",className:h,onClick:D=>a?.(D),disabled:o,"aria-label":e||p,children:[r.jsx(w,{icon:i}),e&&r.jsx("span",{className:u,children:e}),r.jsx(w,{icon:l})]})},F=({errorText:e})=>e&&r.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),P=({fieldTitle:e,htmlFor:s,optional:t,optionalText:n,cssClass:a})=>e?r.jsxs("label",{className:d("dial-tiny text-secondary",a,!a?.includes("mb")&&"mb-2"),htmlFor:s,children:[r.jsx("span",{className:"min-h-4",children:e}),t&&r.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null;var C=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(C||{});const G={info:r.jsx(b.IconInfoCircle,{size:24,stroke:2}),error:r.jsx(b.IconAlertCircle,{size:24,stroke:2}),warning:r.jsx(b.IconAlertTriangle,{size:24,stroke:2}),success:r.jsx(b.IconCircleCheck,{size:24,stroke:2})},Z={[C.Info]:"bg-info border-info text-info",[C.Success]:"bg-success border-success text-success",[C.Warning]:"bg-warning border-warning text-warning",[C.Error]:"bg-error border-error text-error"},X="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",Y=({variant:e=C.Info,message:s,cssClass:t,closable:n=!1,onClose:a})=>r.jsxs("div",{role:"alert",className:d(X,Z[e],t),children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(w,{icon:G[e]}),r.jsx("div",{className:"text-primary",children:s})]}),n&&r.jsx(V,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:r.jsx(b.IconX,{size:16}),onClick:o=>a?.(o)})]}),J="flex items-center justify-center text-secondary",Q="shrink-0 grow-0 basis-auto animate-spin-steps",ee=({size:e=18,cssClass:s,iconClass:t,fullWidth:n=!0,ariaLabel:a="Loading"})=>r.jsx("div",{role:"status","aria-label":a,className:d({[J]:!0,"w-full h-full":n,[s||""]:!!s}),children:r.jsx(w,{icon:r.jsx(b.IconLoader,{width:e,height:e,className:d(Q,t)})})}),re=7,se=2,z=m.createContext(null),M=()=>{const e=m.useContext(z);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},te=({initialOpen:e=!1,placement:s="bottom",isTriggerClickable:t=!1,open:n,onOpenChange:a}={})=>{const[o,l]=m.useState(e),i=m.useRef(null),c=n??o,p=a??l,u=x.useFloating({placement:s,open:c,onOpenChange:p,whileElementsMounted:x.autoUpdate,middleware:[x.offset(re+se),x.flip({crossAxis:s.includes("-"),fallbackAxisSideDirection:"start",padding:5}),x.shift({padding:5}),x.arrow({element:i})]}),h=x.useHover(u.context,{move:!1,enabled:n==null,mouseOnly:t,delay:{open:500,close:0}}),D=x.useFocus(u.context,{enabled:n==null}),A=x.useDismiss(u.context),j=x.useRole(u.context,{role:"tooltip"}),g=x.useInteractions([h,D,A,j]);return m.useMemo(()=>({open:c,setOpen:p,arrowRef:i,...g,...u}),[c,p,g,u])},ne=({children:e,...s})=>{const t=te(s);return r.jsx(z.Provider,{value:t,children:e})},ae=m.forwardRef(function({style:s,...t},n){const a=M(),o=x.useMergeRefs([a.refs.setFloating,n]);return a.open?r.jsx(x.FloatingPortal,{id:"tooltip-portal",children:r.jsxs("div",{ref:o,style:{...a.floatingStyles,...s},...a.getFloatingProps(t),className:d("z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",a.getFloatingProps(t).className),children:[t.children,r.jsx(x.FloatingArrow,{ref:a.arrowRef,context:a.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),oe=m.forwardRef(function({children:s,asChild:t=!1,...n},a){const o=M(),i=s&&typeof s=="object"&&"ref"in s&&s.ref!==void 0?s.ref:void 0,c=x.useMergeRefs([o.refs.setReference,a,i]);return t&&m.isValidElement(s)?m.cloneElement(s,o.getReferenceProps({ref:c,...n,...s.props})):r.jsx("span",{ref:c,...o.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:s})}),N=({hideTooltip:e,tooltip:s,children:t,triggerClassName:n,contentClassName:a,...o})=>e||!s?r.jsx("span",{className:n,children:t}):r.jsxs(ne,{...o,children:[r.jsx(oe,{className:d(n,"truncate"),children:t}),r.jsx(ae,{className:d("text-primary",a,"max-w-[300px]",(e||!s)&&"hidden"),children:s})]}),le=18,E={size:le,stroke:2},ie=({label:e,id:s,checked:t,indeterminate:n,disabled:a,ariaLabel:o,onChange:l})=>{const i=m.useCallback(u=>{u.stopPropagation(),l?.(u.target.checked,s)},[l,s]),c=d("flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",`${t?"":'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,a?"pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4":""),p=d("mr-2 border rounded",a?"bg-layer-4 border-icon-secondary":"");return r.jsxs("label",{className:c,htmlFor:s,children:[t&&(n?r.jsx(b.IconMinus,{className:p,...E}):r.jsx(b.IconCheck,{className:p,...E})),e&&r.jsx(N,{tooltip:e,triggerClassName:"flex-1 min-w-0",children:r.jsx("p",{className:"text-primary w-full truncate",children:e})}),r.jsx("input",{type:"checkbox",onChange:i,id:s,checked:t,"aria-checked":n?"mixed":t,"aria-disabled":a||void 0,"aria-label":e?void 0:o,className:"invisible w-0 h-0"})]})};var f=(e=>(e.VALID="valid",e.ERROR="error",e))(f||{});const ce=(e,s)=>{if(s===e.id)switch(e.status){case f.VALID:return"border-accent-secondary text-primary";case f.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case f.VALID:return"border-primary text-white";case f.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},de=(e,s)=>{if(s===e.id)switch(e.status){case f.VALID:return"bg-accent-secondary";case f.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case f.VALID:return"bg-accent-secondary";case f.ERROR:return"bg-red-400";default:return"bg-layer-4"}},ue=({step:e,index:s,currentStep:t,onChangeStep:n})=>{const a="h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer",o="w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white",l=()=>t===e.id&&e.status===f.ERROR?r.jsx(b.IconExclamationCircle,{stroke:2,size:16}):t!==e.id&&e.status===f.VALID?r.jsx(b.IconCheck,{stroke:2,size:16}):s+1;return r.jsxs("button",{className:d(a,ce(e,t)),onClick:()=>n(e.id),children:[r.jsx("span",{className:d(o,de(e,t)),children:l()}),r.jsx("span",{children:e.name})]})},xe=({steps:e,currentStep:s,onChangeStep:t})=>{const n=a=>{const o=e.findIndex(i=>i.id===s),l=e.findIndex(i=>i.id===a);(a!==s&&e[o].status===f.VALID||l<o)&&t(a)};return r.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>r.jsx(ue,{currentStep:s,onChangeStep:n,step:a,index:o},a.id))})},_=({value:e,textareaId:s,placeholder:t,cssClass:n="",disabled:a,invalid:o,readonly:l,onChange:i})=>r.jsx(N,{tooltip:e,triggerClassName:"flex",children:r.jsx("textarea",{id:s,placeholder:t,value:e||"",disabled:a,className:d("dial-textarea dial-input",o?"dial-input-error":"",a&&"dial-input-disable",l&&"dial-input-readonly",n),onChange:c=>!l&&i?.(c.currentTarget.value)})}),pe=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],fe=(e,s,t,n)=>{if((s==="number"||t!==void 0||n!==void 0)&&!pe.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(t===void 0||t<0))&&!(e.key==="."&&s==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(t!==void 0||n!==void 0){const o=e.currentTarget.value,l=e.currentTarget.selectionStart||0,i=o.slice(0,l)+e.key+o.slice(l),c=parseFloat(i);if(!isNaN(c)){if(t!==void 0&&c<t){e.preventDefault();return}if(n!==void 0&&c>n){e.preventDefault();return}}}}},T=({iconBeforeInput:e,iconAfterInput:s,hideBorder:t,value:n,elementId:a,placeholder:o="",cssClass:l="",containerCssClass:i,tooltipTriggerClassName:c,type:p="text",disabled:u,readonly:h,invalid:D,onChange:A,min:j,max:g,prefix:L,suffix:O,textBeforeInput:v,textAfterInput:I})=>{const q=y=>y.target.blur(),H=p==="number"||j!==void 0||g!==void 0,U=y=>{fe(y,p,j,g)},$=y=>{const R=y.currentTarget.value;if(H&&R!==""){const S=parseFloat(R);if(isNaN(S)&&R!=="-"&&R!=="."||!isNaN(S)&&(j!==void 0&&S<j||g!==void 0&&S>g))return}A?.(R)};return r.jsxs("div",{className:d("dial-input-field flex flex-row items-center justify-between",t?"dial-input-no-border":"dial-input",D&&"dial-input-error",u&&"dial-input-disable",h&&"dial-input-readonly",!v&&"pl-1",!I&&"pr-1",i),children:[v&&r.jsx(N,{tooltip:v,children:r.jsx(T,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"px-2 overflow-hidden overflow-ellipsis dial-small",value:v,disabled:!0,elementId:v+"textBefore"})}),L&&r.jsxs("p",{className:"text-secondary dial-small pl-2",children:[" ",L]}),r.jsx(w,{icon:e,className:"pl-2"}),r.jsx(N,{tooltip:n,triggerClassName:c,children:r.jsx("input",{type:p,autoComplete:"off",id:a,placeholder:o,value:n??"",title:n?String(n):"",disabled:u,className:d("border-0 bg-transparent px-2",l),onChange:y=>!h&&$?.(y),onKeyDown:U,onWheel:q,min:j,max:g})}),r.jsx(w,{icon:s,className:"pr-2"}),O&&r.jsxs("p",{className:"text-secondary dial-small pr-2",children:[" ",O]}),I&&r.jsx(N,{tooltip:I,children:r.jsx(T,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",cssClass:"px-2",value:I,disabled:!0,elementId:I+"textAfter"})})]})},me=/^0+\.(\d+)?$/,be=/^0+/,W=({fieldTitle:e,errorText:s,optional:t,elementCssClass:n,elementContainerCssClass:a,elementId:o,containerCssClass:l,readonly:i,defaultEmptyText:c,min:p,max:u,...h})=>r.jsxs("div",{className:d("flex flex-col",l),children:[r.jsx(P,{fieldTitle:e,optional:t,htmlFor:o}),i?r.jsx("span",{children:h.value||(c??"None")}):r.jsxs(r.Fragment,{children:[r.jsx(T,{elementId:o,cssClass:n,containerCssClass:a,invalid:s!=null,min:p,max:u,...h}),r.jsx(F,{errorText:s})]})]}),he=({onChange:e,value:s,min:t,max:n,...a})=>{const o=l=>String(l)?.match(me)?String(l)?.replace(be,"0"):Number(l);return r.jsx(W,{type:"number",onChange:l=>e?.(o(l)),value:s,min:t,max:n,...a})},ge=({onChange:e,...s})=>r.jsx(W,{type:"text",onChange:t=>e?.(t),...s}),je=({fieldTitle:e,optional:s,elementId:t,elementCssClass:n,errorText:a,...o})=>r.jsxs("div",{className:"flex flex-col",children:[r.jsx(P,{fieldTitle:e,optional:s,htmlFor:t}),r.jsx(_,{textareaId:t,cssClass:n,...o}),r.jsx(F,{errorText:a})]}),ye=({title:e,switchId:s,isOn:t=!1,disabled:n,onChange:a})=>{const o=d("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",t?"flex-row-reverse":"flex-row",n?"pointer-events-none":"",n?t?"bg-controls-disable":"bg-layer-4":t?"bg-accent-primary":"bg-layer-4"),l=m.useCallback(i=>{i.stopPropagation(),a?.(!t)},[a,t]);return r.jsxs("div",{className:"flex flex-row items-center",children:[r.jsx("input",{type:"checkbox",onChange:l,id:s,disabled:n,className:"invisible w-0 h-0",checked:t}),r.jsx("label",{htmlFor:s,className:o,children:r.jsx("span",{className:d("size-3 rounded-full",n?t?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&r.jsx("span",{className:"pl-2 dial-small text-primary",children:e})]})},Ce=({onClick:e})=>r.jsx(b.IconEyeOff,{...E,className:"text-primary",onClick:e}),we=({onClick:e})=>r.jsx(b.IconEye,{...E,className:"text-primary",onClick:e}),B=({...e})=>{const[s,t]=m.useState(!1),n=m.useCallback(a=>{t(a)},[]);return r.jsx(T,{type:s?"text":"password",...e,iconAfterInput:s?r.jsx(Ce,{onClick:()=>n(!1)}):r.jsx(we,{onClick:()=>n(!0)})})},Ne=({fieldTitle:e,optional:s,elementCssClass:t,elementId:n,errorText:a,...o})=>r.jsxs("div",{className:"flex flex-col",children:[r.jsx(P,{fieldTitle:e,optional:s,htmlFor:n}),r.jsx(B,{cssClass:t,elementId:n,invalid:!!a,...o}),r.jsx(F,{errorText:a})]});exports.AlertVariant=C;exports.ButtonVariant=k;exports.DialAlert=Y;exports.DialButton=V;exports.DialCheckbox=ie;exports.DialErrorText=F;exports.DialFieldLabel=P;exports.DialIcon=w;exports.DialInput=T;exports.DialLoader=ee;exports.DialNumberInputField=he;exports.DialPasswordInput=B;exports.DialPasswordInputField=Ne;exports.DialSteps=xe;exports.DialSwitch=ye;exports.DialTextAreaField=je;exports.DialTextInputField=ge;exports.DialTextarea=_;exports.DialTooltip=N;exports.StepStatus=f;
@@ -1,18 +1,18 @@
1
- import { jsx as n, jsxs as m, Fragment as $ } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as m, Fragment as G } from "react/jsx-runtime";
2
2
  import d from "classnames";
3
- import { IconCircleCheck as G, IconAlertTriangle as Z, IconAlertCircle as X, IconInfoCircle as Y, IconX as q, IconLoader as J, IconMinus as Q, IconCheck as A, IconExclamationCircle as ee } from "@tabler/icons-react";
4
- import { createContext as re, useState as te, useRef as ne, useMemo as se, useContext as oe, forwardRef as L, isValidElement as ae, cloneElement as le, useCallback as O } from "react";
5
- import { useFloating as ie, offset as ce, flip as de, shift as ue, arrow as me, autoUpdate as fe, useHover as pe, useFocus as be, useDismiss as he, useRole as ge, useInteractions as xe, useMergeRefs as z, FloatingPortal as ye, FloatingArrow as Ne } from "@floating-ui/react";
6
- const N = ({ icon: e, className: r }) => e ? /* @__PURE__ */ n("span", { className: d("flex-shrink-0", r), children: e }) : null;
3
+ import { IconCircleCheck as Z, IconAlertTriangle as X, IconAlertCircle as Y, IconInfoCircle as q, IconX as J, IconLoader as Q, IconMinus as ee, IconCheck as V, IconExclamationCircle as re, IconEyeOff as te, IconEye as ne } from "@tabler/icons-react";
4
+ import { createContext as se, useState as z, useRef as oe, useMemo as ae, useContext as le, forwardRef as _, isValidElement as ie, cloneElement as ce, useCallback as S } from "react";
5
+ import { useFloating as de, offset as ue, flip as me, shift as fe, arrow as pe, autoUpdate as he, useHover as be, useFocus as ge, useDismiss as xe, useRole as ye, useInteractions as Ce, useMergeRefs as j, FloatingPortal as Ne, FloatingArrow as we } from "@floating-ui/react";
6
+ const C = ({ icon: e, className: r }) => e ? /* @__PURE__ */ t("span", { className: d("flex-shrink-0", r), children: e }) : null;
7
7
  var k = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e))(k || {});
8
- const Ce = {
8
+ const ve = {
9
9
  [k.Primary]: "dial-primary-button",
10
10
  [k.Secondary]: "dial-secondary-button",
11
11
  [k.Tertiary]: "dial-tertiary-button"
12
- }, we = ({
12
+ }, De = ({
13
13
  title: e,
14
14
  variant: r,
15
- cssClass: t,
15
+ cssClass: n,
16
16
  ref: s,
17
17
  onClick: o,
18
18
  disable: a,
@@ -26,9 +26,9 @@ const Ce = {
26
26
  l ? "mr-2" : "",
27
27
  i ? "ml-2" : "",
28
28
  c ? "hidden sm:inline" : "inline"
29
- ), b = d(
30
- r && Ce[r],
31
- t,
29
+ ), h = d(
30
+ r && ve[r],
31
+ n,
32
32
  "focus-visible:outline outline-offset-0"
33
33
  );
34
34
  return /* @__PURE__ */ m(
@@ -36,21 +36,21 @@ const Ce = {
36
36
  {
37
37
  ref: s,
38
38
  type: "button",
39
- className: b,
40
- onClick: (C) => o?.(C),
39
+ className: h,
40
+ onClick: (N) => o?.(N),
41
41
  disabled: a,
42
42
  "aria-label": e || f,
43
43
  children: [
44
- /* @__PURE__ */ n(N, { icon: i }),
45
- e && /* @__PURE__ */ n("span", { className: u, children: e }),
46
- /* @__PURE__ */ n(N, { icon: l })
44
+ /* @__PURE__ */ t(C, { icon: i }),
45
+ e && /* @__PURE__ */ t("span", { className: u, children: e }),
46
+ /* @__PURE__ */ t(C, { icon: l })
47
47
  ]
48
48
  }
49
49
  );
50
- }, V = ({ errorText: e }) => e && /* @__PURE__ */ n("span", { className: "text-error dial-tiny mt-1", children: e }), _ = ({
50
+ }, P = ({ errorText: e }) => e && /* @__PURE__ */ t("span", { className: "text-error dial-tiny mt-1", children: e }), A = ({
51
51
  fieldTitle: e,
52
52
  htmlFor: r,
53
- optional: t,
53
+ optional: n,
54
54
  optionalText: s,
55
55
  cssClass: o
56
56
  }) => e ? /* @__PURE__ */ m(
@@ -63,26 +63,26 @@ const Ce = {
63
63
  ),
64
64
  htmlFor: r,
65
65
  children: [
66
- /* @__PURE__ */ n("span", { className: "min-h-4", children: e }),
67
- t && /* @__PURE__ */ n("span", { className: "ml-1", children: s ?? "(Optional)" })
66
+ /* @__PURE__ */ t("span", { className: "min-h-4", children: e }),
67
+ n && /* @__PURE__ */ t("span", { className: "ml-1", children: s ?? "(Optional)" })
68
68
  ]
69
69
  }
70
70
  ) : null;
71
71
  var y = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(y || {});
72
- const ve = {
73
- info: /* @__PURE__ */ n(Y, { size: 24, stroke: 2 }),
74
- error: /* @__PURE__ */ n(X, { size: 24, stroke: 2 }),
75
- warning: /* @__PURE__ */ n(Z, { size: 24, stroke: 2 }),
76
- success: /* @__PURE__ */ n(G, { size: 24, stroke: 2 })
77
- }, De = {
72
+ const Ie = {
73
+ info: /* @__PURE__ */ t(q, { size: 24, stroke: 2 }),
74
+ error: /* @__PURE__ */ t(Y, { size: 24, stroke: 2 }),
75
+ warning: /* @__PURE__ */ t(X, { size: 24, stroke: 2 }),
76
+ success: /* @__PURE__ */ t(Z, { size: 24, stroke: 2 })
77
+ }, Re = {
78
78
  [y.Info]: "bg-info border-info text-info",
79
79
  [y.Success]: "bg-success border-success text-success",
80
80
  [y.Warning]: "bg-warning border-warning text-warning",
81
81
  [y.Error]: "bg-error border-error text-error"
82
- }, Ie = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", Ze = ({
82
+ }, ke = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", Qe = ({
83
83
  variant: e = y.Info,
84
84
  message: r,
85
- cssClass: t,
85
+ cssClass: n,
86
86
  closable: s = !1,
87
87
  onClose: o
88
88
  }) => /* @__PURE__ */ m(
@@ -90,112 +90,112 @@ const ve = {
90
90
  {
91
91
  role: "alert",
92
92
  className: d(
93
- Ie,
94
- De[e],
95
- t
93
+ ke,
94
+ Re[e],
95
+ n
96
96
  ),
97
97
  children: [
98
98
  /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
99
- /* @__PURE__ */ n(N, { icon: ve[e] }),
100
- /* @__PURE__ */ n("div", { className: "text-primary", children: r })
99
+ /* @__PURE__ */ t(C, { icon: Ie[e] }),
100
+ /* @__PURE__ */ t("div", { className: "text-primary", children: r })
101
101
  ] }),
102
- s && /* @__PURE__ */ n(
103
- we,
102
+ s && /* @__PURE__ */ t(
103
+ De,
104
104
  {
105
105
  cssClass: "ml-2 text-secondary hover:text-primary",
106
106
  ariaLabel: "Close alert",
107
- iconBefore: /* @__PURE__ */ n(q, { size: 16 }),
107
+ iconBefore: /* @__PURE__ */ t(J, { size: 16 }),
108
108
  onClick: (a) => o?.(a)
109
109
  }
110
110
  )
111
111
  ]
112
112
  }
113
- ), Re = "flex items-center justify-center text-secondary", ke = "shrink-0 grow-0 basis-auto animate-spin-steps", Xe = ({
113
+ ), Te = "flex items-center justify-center text-secondary", Ee = "shrink-0 grow-0 basis-auto animate-spin-steps", er = ({
114
114
  size: e = 18,
115
115
  cssClass: r,
116
- iconClass: t,
116
+ iconClass: n,
117
117
  fullWidth: s = !0,
118
118
  ariaLabel: o = "Loading"
119
- }) => /* @__PURE__ */ n(
119
+ }) => /* @__PURE__ */ t(
120
120
  "div",
121
121
  {
122
122
  role: "status",
123
123
  "aria-label": o,
124
124
  className: d({
125
- [Re]: !0,
125
+ [Te]: !0,
126
126
  "w-full h-full": s,
127
127
  [r || ""]: !!r
128
128
  }),
129
- children: /* @__PURE__ */ n(
130
- N,
129
+ children: /* @__PURE__ */ t(
130
+ C,
131
131
  {
132
- icon: /* @__PURE__ */ n(
133
- J,
132
+ icon: /* @__PURE__ */ t(
133
+ Q,
134
134
  {
135
135
  width: e,
136
136
  height: e,
137
- className: d(ke, t)
137
+ className: d(Ee, n)
138
138
  }
139
139
  )
140
140
  }
141
141
  )
142
142
  }
143
- ), Te = 7, Ee = 2, j = re(null), W = () => {
144
- const e = oe(j);
143
+ ), Fe = 7, Se = 2, W = se(null), M = () => {
144
+ const e = le(W);
145
145
  if (e == null)
146
146
  throw new Error("Tooltip components must be wrapped in <Tooltip />");
147
147
  return e;
148
- }, Fe = ({
148
+ }, Pe = ({
149
149
  initialOpen: e = !1,
150
150
  placement: r = "bottom",
151
- isTriggerClickable: t = !1,
151
+ isTriggerClickable: n = !1,
152
152
  open: s,
153
153
  onOpenChange: o
154
154
  } = {}) => {
155
- const [a, l] = te(e), i = ne(null), c = s ?? a, f = o ?? l, u = ie({
155
+ const [a, l] = z(e), i = oe(null), c = s ?? a, f = o ?? l, u = de({
156
156
  placement: r,
157
157
  open: c,
158
158
  onOpenChange: f,
159
- whileElementsMounted: fe,
159
+ whileElementsMounted: he,
160
160
  middleware: [
161
- ce(Te + Ee),
162
- de({
161
+ ue(Fe + Se),
162
+ me({
163
163
  crossAxis: r.includes("-"),
164
164
  fallbackAxisSideDirection: "start",
165
165
  padding: 5
166
166
  }),
167
- ue({ padding: 5 }),
168
- me({
167
+ fe({ padding: 5 }),
168
+ pe({
169
169
  element: i
170
170
  })
171
171
  ]
172
- }), b = pe(u.context, {
172
+ }), h = be(u.context, {
173
173
  move: !1,
174
174
  enabled: s == null,
175
- mouseOnly: t,
175
+ mouseOnly: n,
176
176
  delay: { open: 500, close: 0 }
177
- }), C = be(u.context, {
177
+ }), N = ge(u.context, {
178
178
  enabled: s == null
179
- }), T = he(u.context), g = ge(u.context, { role: "tooltip" }), h = xe([b, C, T, g]);
180
- return se(
179
+ }), F = xe(u.context), g = ye(u.context, { role: "tooltip" }), b = Ce([h, N, F, g]);
180
+ return ae(
181
181
  () => ({
182
182
  open: c,
183
183
  setOpen: f,
184
184
  arrowRef: i,
185
- ...h,
185
+ ...b,
186
186
  ...u
187
187
  }),
188
- [c, f, h, u]
188
+ [c, f, b, u]
189
189
  );
190
- }, Pe = ({
190
+ }, Ae = ({
191
191
  children: e,
192
192
  ...r
193
193
  }) => {
194
- const t = Fe(r);
195
- return /* @__PURE__ */ n(j.Provider, { value: t, children: e });
196
- }, Se = L(function({ style: r, ...t }, s) {
197
- const o = W(), a = z([o.refs.setFloating, s]);
198
- return o.open ? /* @__PURE__ */ n(ye, { id: "tooltip-portal", children: /* @__PURE__ */ m(
194
+ const n = Pe(r);
195
+ return /* @__PURE__ */ t(W.Provider, { value: n, children: e });
196
+ }, Le = _(function({ style: r, ...n }, s) {
197
+ const o = M(), a = j([o.refs.setFloating, s]);
198
+ return o.open ? /* @__PURE__ */ t(Ne, { id: "tooltip-portal", children: /* @__PURE__ */ m(
199
199
  "div",
200
200
  {
201
201
  ref: a,
@@ -203,15 +203,15 @@ const ve = {
203
203
  ...o.floatingStyles,
204
204
  ...r
205
205
  },
206
- ...o.getFloatingProps(t),
206
+ ...o.getFloatingProps(n),
207
207
  className: d(
208
208
  "z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
209
- o.getFloatingProps(t).className
209
+ o.getFloatingProps(n).className
210
210
  ),
211
211
  children: [
212
- t.children,
213
- /* @__PURE__ */ n(
214
- Ne,
212
+ n.children,
213
+ /* @__PURE__ */ t(
214
+ we,
215
215
  {
216
216
  ref: o.arrowRef,
217
217
  context: o.context,
@@ -223,16 +223,16 @@ const ve = {
223
223
  ]
224
224
  }
225
225
  ) }) : null;
226
- }), Ae = L(function({ children: r, asChild: t = !1, ...s }, o) {
227
- const a = W(), i = r && typeof r == "object" && "ref" in r && r.ref !== void 0 ? r.ref : void 0, c = z([a.refs.setReference, o, i]);
228
- return t && ae(r) ? le(
226
+ }), Oe = _(function({ children: r, asChild: n = !1, ...s }, o) {
227
+ const a = M(), i = r && typeof r == "object" && "ref" in r && r.ref !== void 0 ? r.ref : void 0, c = j([a.refs.setReference, o, i]);
228
+ return n && ie(r) ? ce(
229
229
  r,
230
230
  a.getReferenceProps({
231
231
  ref: c,
232
232
  ...s,
233
233
  ...r.props
234
234
  })
235
- ) : /* @__PURE__ */ n(
235
+ ) : /* @__PURE__ */ t(
236
236
  "span",
237
237
  {
238
238
  ref: c,
@@ -244,14 +244,14 @@ const ve = {
244
244
  }), I = ({
245
245
  hideTooltip: e,
246
246
  tooltip: r,
247
- children: t,
247
+ children: n,
248
248
  triggerClassName: s,
249
249
  contentClassName: o,
250
250
  ...a
251
- }) => e || !r ? /* @__PURE__ */ n("span", { className: s, children: t }) : /* @__PURE__ */ m(Pe, { ...a, children: [
252
- /* @__PURE__ */ n(Ae, { className: d(s, "truncate"), children: t }),
253
- /* @__PURE__ */ n(
254
- Se,
251
+ }) => e || !r ? /* @__PURE__ */ t("span", { className: s, children: n }) : /* @__PURE__ */ m(Ae, { ...a, children: [
252
+ /* @__PURE__ */ t(Oe, { className: d(s, "truncate"), children: n }),
253
+ /* @__PURE__ */ t(
254
+ Le,
255
255
  {
256
256
  className: d(
257
257
  "text-primary",
@@ -262,42 +262,42 @@ const ve = {
262
262
  children: r
263
263
  }
264
264
  )
265
- ] }), Le = 18, S = {
266
- size: Le,
265
+ ] }), Ve = 18, T = {
266
+ size: Ve,
267
267
  stroke: 2
268
- }, Ye = ({
268
+ }, rr = ({
269
269
  label: e,
270
270
  id: r,
271
- checked: t,
271
+ checked: n,
272
272
  indeterminate: s,
273
273
  disabled: o,
274
274
  ariaLabel: a,
275
275
  onChange: l
276
276
  }) => {
277
- const i = O(
277
+ const i = S(
278
278
  (u) => {
279
279
  u.stopPropagation(), l?.(u.target.checked, r);
280
280
  },
281
281
  [l, r]
282
282
  ), c = d(
283
283
  "flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",
284
- `${t ? "" : 'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,
284
+ `${n ? "" : 'before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:border before:border-hover before:rounded before:mr-2'}`,
285
285
  o ? "pointer-events-none text-secondary before:border-icon-secondary before:bg-layer-4" : ""
286
286
  ), f = d(
287
287
  "mr-2 border rounded",
288
288
  o ? "bg-layer-4 border-icon-secondary" : ""
289
289
  );
290
290
  return /* @__PURE__ */ m("label", { className: c, htmlFor: r, children: [
291
- t && (s ? /* @__PURE__ */ n(Q, { className: f, ...S }) : /* @__PURE__ */ n(A, { className: f, ...S })),
292
- e && /* @__PURE__ */ n(I, { tooltip: e, triggerClassName: "flex-1 min-w-0", children: /* @__PURE__ */ n("p", { className: "text-primary w-full truncate", children: e }) }),
293
- /* @__PURE__ */ n(
291
+ n && (s ? /* @__PURE__ */ t(ee, { className: f, ...T }) : /* @__PURE__ */ t(V, { className: f, ...T })),
292
+ e && /* @__PURE__ */ t(I, { tooltip: e, triggerClassName: "flex-1 min-w-0", children: /* @__PURE__ */ t("p", { className: "text-primary w-full truncate", children: e }) }),
293
+ /* @__PURE__ */ t(
294
294
  "input",
295
295
  {
296
296
  type: "checkbox",
297
297
  onChange: i,
298
298
  id: r,
299
- checked: t,
300
- "aria-checked": s ? "mixed" : t,
299
+ checked: n,
300
+ "aria-checked": s ? "mixed" : n,
301
301
  "aria-disabled": o || void 0,
302
302
  "aria-label": e ? void 0 : a,
303
303
  className: "invisible w-0 h-0"
@@ -306,7 +306,7 @@ const ve = {
306
306
  ] });
307
307
  };
308
308
  var p = /* @__PURE__ */ ((e) => (e.VALID = "valid", e.ERROR = "error", e))(p || {});
309
- const Oe = (e, r) => {
309
+ const ze = (e, r) => {
310
310
  if (r === e.id)
311
311
  switch (e.status) {
312
312
  case p.VALID:
@@ -324,7 +324,7 @@ const Oe = (e, r) => {
324
324
  default:
325
325
  return "border-primary text-secondary";
326
326
  }
327
- }, ze = (e, r) => {
327
+ }, _e = (e, r) => {
328
328
  if (r === e.id)
329
329
  switch (e.status) {
330
330
  case p.VALID:
@@ -342,63 +342,63 @@ const Oe = (e, r) => {
342
342
  default:
343
343
  return "bg-layer-4";
344
344
  }
345
- }, Ve = ({
345
+ }, je = ({
346
346
  step: e,
347
347
  index: r,
348
- currentStep: t,
349
- handleStepChange: s
348
+ currentStep: n,
349
+ onChangeStep: s
350
350
  }) => {
351
- const o = "h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer", a = "w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white", l = () => t === e.id && e.status === p.ERROR ? /* @__PURE__ */ n(ee, { stroke: 2, size: 16 }) : t !== e.id && e.status === p.VALID ? /* @__PURE__ */ n(A, { stroke: 2, size: 16 }) : r + 1;
351
+ const o = "h-[32px] flex flex-1 min-w-[180px] items-center dial-tiny border-t-2 cursor-pointer", a = "w-[22px] h-[22px] flex justify-center items-center mr-2 rounded-full text-white", l = () => n === e.id && e.status === p.ERROR ? /* @__PURE__ */ t(re, { stroke: 2, size: 16 }) : n !== e.id && e.status === p.VALID ? /* @__PURE__ */ t(V, { stroke: 2, size: 16 }) : r + 1;
352
352
  return /* @__PURE__ */ m(
353
353
  "button",
354
354
  {
355
- className: d(o, Oe(e, t)),
355
+ className: d(o, ze(e, n)),
356
356
  onClick: () => s(e.id),
357
357
  children: [
358
- /* @__PURE__ */ n(
358
+ /* @__PURE__ */ t(
359
359
  "span",
360
360
  {
361
- className: d(a, ze(e, t)),
361
+ className: d(a, _e(e, n)),
362
362
  children: l()
363
363
  }
364
364
  ),
365
- /* @__PURE__ */ n("span", { children: e.name })
365
+ /* @__PURE__ */ t("span", { children: e.name })
366
366
  ]
367
367
  }
368
368
  );
369
- }, qe = ({
369
+ }, tr = ({
370
370
  steps: e,
371
371
  currentStep: r,
372
- setCurrentStep: t
372
+ onChangeStep: n
373
373
  }) => {
374
374
  const s = (o) => {
375
375
  const a = e.findIndex((i) => i.id === r), l = e.findIndex((i) => i.id === o);
376
- (o !== r && e[a].status === p.VALID || l < a) && t(o);
376
+ (o !== r && e[a].status === p.VALID || l < a) && n(o);
377
377
  };
378
- return /* @__PURE__ */ n("div", { id: "steps", className: "flex gap-x-3", children: e.map((o, a) => /* @__PURE__ */ n(
379
- Ve,
378
+ return /* @__PURE__ */ t("div", { id: "steps", className: "flex gap-x-3", children: e.map((o, a) => /* @__PURE__ */ t(
379
+ je,
380
380
  {
381
381
  currentStep: r,
382
- handleStepChange: s,
382
+ onChangeStep: s,
383
383
  step: o,
384
384
  index: a
385
385
  },
386
386
  o.id
387
387
  )) });
388
- }, _e = ({
388
+ }, We = ({
389
389
  value: e,
390
390
  textareaId: r,
391
- placeholder: t,
391
+ placeholder: n,
392
392
  cssClass: s = "",
393
393
  disabled: o,
394
394
  invalid: a,
395
395
  readonly: l,
396
396
  onChange: i
397
- }) => /* @__PURE__ */ n(I, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ n(
397
+ }) => /* @__PURE__ */ t(I, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ t(
398
398
  "textarea",
399
399
  {
400
400
  id: r,
401
- placeholder: t,
401
+ placeholder: n,
402
402
  value: e || "",
403
403
  disabled: o,
404
404
  className: d(
@@ -410,7 +410,7 @@ const Oe = (e, r) => {
410
410
  ),
411
411
  onChange: (c) => !l && i?.(c.currentTarget.value)
412
412
  }
413
- ) }), je = [
413
+ ) }), Me = [
414
414
  "ArrowLeft",
415
415
  "ArrowRight",
416
416
  "ArrowUp",
@@ -422,16 +422,16 @@ const Oe = (e, r) => {
422
422
  "Escape",
423
423
  "Home",
424
424
  "End"
425
- ], We = (e, r, t, s) => {
426
- if ((r === "number" || t !== void 0 || s !== void 0) && !je.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (t === void 0 || t < 0)) && !(e.key === "." && r === "number" && !e.currentTarget.value.includes("."))) {
425
+ ], He = (e, r, n, s) => {
426
+ if ((r === "number" || n !== void 0 || s !== void 0) && !Me.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (n === void 0 || n < 0)) && !(e.key === "." && r === "number" && !e.currentTarget.value.includes("."))) {
427
427
  if (!/^[0-9]$/.test(e.key)) {
428
428
  e.preventDefault();
429
429
  return;
430
430
  }
431
- if (t !== void 0 || s !== void 0) {
431
+ if (n !== void 0 || s !== void 0) {
432
432
  const a = e.currentTarget.value, l = e.currentTarget.selectionStart || 0, i = a.slice(0, l) + e.key + a.slice(l), c = parseFloat(i);
433
433
  if (!isNaN(c)) {
434
- if (t !== void 0 && c < t) {
434
+ if (n !== void 0 && c < n) {
435
435
  e.preventDefault();
436
436
  return;
437
437
  }
@@ -445,7 +445,7 @@ const Oe = (e, r) => {
445
445
  }, E = ({
446
446
  iconBeforeInput: e,
447
447
  iconAfterInput: r,
448
- hideBorder: t,
448
+ hideBorder: n,
449
449
  value: s,
450
450
  elementId: o,
451
451
  placeholder: a = "",
@@ -454,42 +454,42 @@ const Oe = (e, r) => {
454
454
  tooltipTriggerClassName: c,
455
455
  type: f = "text",
456
456
  disabled: u,
457
- readonly: b,
458
- invalid: C,
459
- onChange: T,
457
+ readonly: h,
458
+ invalid: N,
459
+ onChange: F,
460
460
  min: g,
461
- max: h,
462
- prefix: F,
463
- suffix: P,
461
+ max: b,
462
+ prefix: L,
463
+ suffix: O,
464
464
  textBeforeInput: w,
465
465
  textAfterInput: v
466
466
  }) => {
467
- const B = (x) => x.target.blur(), H = f === "number" || g !== void 0 || h !== void 0, U = (x) => {
468
- We(x, f, g, h);
469
- }, K = (x) => {
467
+ const B = (x) => x.target.blur(), U = f === "number" || g !== void 0 || b !== void 0, K = (x) => {
468
+ He(x, f, g, b);
469
+ }, $ = (x) => {
470
470
  const D = x.currentTarget.value;
471
- if (H && D !== "") {
471
+ if (U && D !== "") {
472
472
  const R = parseFloat(D);
473
- if (isNaN(R) && D !== "-" && D !== "." || !isNaN(R) && (g !== void 0 && R < g || h !== void 0 && R > h))
473
+ if (isNaN(R) && D !== "-" && D !== "." || !isNaN(R) && (g !== void 0 && R < g || b !== void 0 && R > b))
474
474
  return;
475
475
  }
476
- T?.(D);
476
+ F?.(D);
477
477
  };
478
478
  return /* @__PURE__ */ m(
479
479
  "div",
480
480
  {
481
481
  className: d(
482
482
  "dial-input-field flex flex-row items-center justify-between",
483
- t ? "dial-input-no-border" : "dial-input",
484
- C && "dial-input-error",
483
+ n ? "dial-input-no-border" : "dial-input",
484
+ N && "dial-input-error",
485
485
  u && "dial-input-disable",
486
- b && "dial-input-readonly",
486
+ h && "dial-input-readonly",
487
487
  !w && "pl-1",
488
488
  !v && "pr-1",
489
489
  i
490
490
  ),
491
491
  children: [
492
- w && /* @__PURE__ */ n(I, { tooltip: w, children: /* @__PURE__ */ n(
492
+ w && /* @__PURE__ */ t(I, { tooltip: w, children: /* @__PURE__ */ t(
493
493
  E,
494
494
  {
495
495
  hideBorder: !0,
@@ -500,12 +500,12 @@ const Oe = (e, r) => {
500
500
  elementId: w + "textBefore"
501
501
  }
502
502
  ) }),
503
- F && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pl-2", children: [
503
+ L && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pl-2", children: [
504
504
  " ",
505
- F
505
+ L
506
506
  ] }),
507
- /* @__PURE__ */ n(N, { icon: e, className: "pl-2" }),
508
- /* @__PURE__ */ n(I, { tooltip: s, triggerClassName: c, children: /* @__PURE__ */ n(
507
+ /* @__PURE__ */ t(C, { icon: e, className: "pl-2" }),
508
+ /* @__PURE__ */ t(I, { tooltip: s, triggerClassName: c, children: /* @__PURE__ */ t(
509
509
  "input",
510
510
  {
511
511
  type: f,
@@ -516,19 +516,19 @@ const Oe = (e, r) => {
516
516
  title: s ? String(s) : "",
517
517
  disabled: u,
518
518
  className: d("border-0 bg-transparent px-2", l),
519
- onChange: (x) => !b && K?.(x),
520
- onKeyDown: U,
519
+ onChange: (x) => !h && $?.(x),
520
+ onKeyDown: K,
521
521
  onWheel: B,
522
522
  min: g,
523
- max: h
523
+ max: b
524
524
  }
525
525
  ) }),
526
- /* @__PURE__ */ n(N, { icon: r, className: "pr-2" }),
527
- P && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pr-2", children: [
526
+ /* @__PURE__ */ t(C, { icon: r, className: "pr-2" }),
527
+ O && /* @__PURE__ */ m("p", { className: "text-secondary dial-small pr-2", children: [
528
528
  " ",
529
- P
529
+ O
530
530
  ] }),
531
- v && /* @__PURE__ */ n(I, { tooltip: v, children: /* @__PURE__ */ n(
531
+ v && /* @__PURE__ */ t(I, { tooltip: v, children: /* @__PURE__ */ t(
532
532
  E,
533
533
  {
534
534
  hideBorder: !0,
@@ -542,10 +542,10 @@ const Oe = (e, r) => {
542
542
  ]
543
543
  }
544
544
  );
545
- }, Me = /^0+\.(\d+)?$/, Be = /^0+/, M = ({
545
+ }, Be = /^0+\.(\d+)?$/, Ue = /^0+/, H = ({
546
546
  fieldTitle: e,
547
547
  errorText: r,
548
- optional: t,
548
+ optional: n,
549
549
  elementCssClass: s,
550
550
  elementContainerCssClass: o,
551
551
  elementId: a,
@@ -554,18 +554,18 @@ const Oe = (e, r) => {
554
554
  defaultEmptyText: c,
555
555
  min: f,
556
556
  max: u,
557
- ...b
557
+ ...h
558
558
  }) => /* @__PURE__ */ m("div", { className: d("flex flex-col", l), children: [
559
- /* @__PURE__ */ n(
560
- _,
559
+ /* @__PURE__ */ t(
560
+ A,
561
561
  {
562
562
  fieldTitle: e,
563
- optional: t,
563
+ optional: n,
564
564
  htmlFor: a
565
565
  }
566
566
  ),
567
- i ? /* @__PURE__ */ n("span", { children: b.value || (c ?? "None") }) : /* @__PURE__ */ m($, { children: [
568
- /* @__PURE__ */ n(
567
+ i ? /* @__PURE__ */ t("span", { children: h.value || (c ?? "None") }) : /* @__PURE__ */ m(G, { children: [
568
+ /* @__PURE__ */ t(
569
569
  E,
570
570
  {
571
571
  elementId: a,
@@ -574,85 +574,85 @@ const Oe = (e, r) => {
574
574
  invalid: r != null,
575
575
  min: f,
576
576
  max: u,
577
- ...b
577
+ ...h
578
578
  }
579
579
  ),
580
- /* @__PURE__ */ n(V, { errorText: r })
580
+ /* @__PURE__ */ t(P, { errorText: r })
581
581
  ] })
582
- ] }), Je = ({
582
+ ] }), nr = ({
583
583
  onChange: e,
584
584
  value: r,
585
- min: t,
585
+ min: n,
586
586
  max: s,
587
587
  ...o
588
588
  }) => {
589
- const a = (l) => String(l)?.match(Me) ? String(l)?.replace(Be, "0") : Number(l);
590
- return /* @__PURE__ */ n(
591
- M,
589
+ const a = (l) => String(l)?.match(Be) ? String(l)?.replace(Ue, "0") : Number(l);
590
+ return /* @__PURE__ */ t(
591
+ H,
592
592
  {
593
593
  type: "number",
594
594
  onChange: (l) => e?.(a(l)),
595
595
  value: r,
596
- min: t,
596
+ min: n,
597
597
  max: s,
598
598
  ...o
599
599
  }
600
600
  );
601
- }, Qe = ({
601
+ }, sr = ({
602
602
  onChange: e,
603
603
  ...r
604
- }) => /* @__PURE__ */ n(
605
- M,
604
+ }) => /* @__PURE__ */ t(
605
+ H,
606
606
  {
607
607
  type: "text",
608
- onChange: (t) => e?.(t),
608
+ onChange: (n) => e?.(n),
609
609
  ...r
610
610
  }
611
- ), er = ({
611
+ ), or = ({
612
612
  fieldTitle: e,
613
613
  optional: r,
614
- elementId: t,
614
+ elementId: n,
615
615
  elementCssClass: s,
616
616
  errorText: o,
617
617
  ...a
618
618
  }) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
619
- /* @__PURE__ */ n(
620
- _,
619
+ /* @__PURE__ */ t(
620
+ A,
621
621
  {
622
622
  fieldTitle: e,
623
623
  optional: r,
624
- htmlFor: t
624
+ htmlFor: n
625
625
  }
626
626
  ),
627
- /* @__PURE__ */ n(
628
- _e,
627
+ /* @__PURE__ */ t(
628
+ We,
629
629
  {
630
- textareaId: t,
630
+ textareaId: n,
631
631
  cssClass: s,
632
632
  ...a
633
633
  }
634
634
  ),
635
- /* @__PURE__ */ n(V, { errorText: o })
636
- ] }), rr = ({
635
+ /* @__PURE__ */ t(P, { errorText: o })
636
+ ] }), ar = ({
637
637
  title: e,
638
638
  switchId: r,
639
- isOn: t = !1,
639
+ isOn: n = !1,
640
640
  disabled: s,
641
641
  onChange: o
642
642
  }) => {
643
643
  const a = d(
644
644
  "flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
645
- t ? "flex-row-reverse" : "flex-row",
645
+ n ? "flex-row-reverse" : "flex-row",
646
646
  s ? "pointer-events-none" : "",
647
- s ? t ? "bg-controls-disable" : "bg-layer-4" : t ? "bg-accent-primary" : "bg-layer-4"
648
- ), l = O(
647
+ s ? n ? "bg-controls-disable" : "bg-layer-4" : n ? "bg-accent-primary" : "bg-layer-4"
648
+ ), l = S(
649
649
  (i) => {
650
- i.stopPropagation(), o?.(!t);
650
+ i.stopPropagation(), o?.(!n);
651
651
  },
652
- [o, t]
652
+ [o, n]
653
653
  );
654
654
  return /* @__PURE__ */ m("div", { className: "flex flex-row items-center", children: [
655
- /* @__PURE__ */ n(
655
+ /* @__PURE__ */ t(
656
656
  "input",
657
657
  {
658
658
  type: "checkbox",
@@ -660,38 +660,85 @@ const Oe = (e, r) => {
660
660
  id: r,
661
661
  disabled: s,
662
662
  className: "invisible w-0 h-0",
663
- checked: t
663
+ checked: n
664
664
  }
665
665
  ),
666
- /* @__PURE__ */ n("label", { htmlFor: r, className: a, children: /* @__PURE__ */ n(
666
+ /* @__PURE__ */ t("label", { htmlFor: r, className: a, children: /* @__PURE__ */ t(
667
667
  "span",
668
668
  {
669
669
  className: d(
670
670
  "size-3 rounded-full",
671
- s ? t ? "bg-layer-4" : "bg-controls-disable" : "bg-controls-enable-primary"
671
+ s ? n ? "bg-layer-4" : "bg-controls-disable" : "bg-controls-enable-primary"
672
672
  )
673
673
  }
674
674
  ) }),
675
- e && /* @__PURE__ */ n("span", { className: "pl-2 dial-small text-primary", children: e })
675
+ e && /* @__PURE__ */ t("span", { className: "pl-2 dial-small text-primary", children: e })
676
676
  ] });
677
- };
677
+ }, Ke = ({ onClick: e }) => /* @__PURE__ */ t(
678
+ te,
679
+ {
680
+ ...T,
681
+ className: "text-primary",
682
+ onClick: e
683
+ }
684
+ ), $e = ({ onClick: e }) => /* @__PURE__ */ t(ne, { ...T, className: "text-primary", onClick: e }), Ge = ({ ...e }) => {
685
+ const [r, n] = z(!1), s = S((o) => {
686
+ n(o);
687
+ }, []);
688
+ return /* @__PURE__ */ t(
689
+ E,
690
+ {
691
+ type: r ? "text" : "password",
692
+ ...e,
693
+ iconAfterInput: r ? /* @__PURE__ */ t(Ke, { onClick: () => s(!1) }) : /* @__PURE__ */ t($e, { onClick: () => s(!0) })
694
+ }
695
+ );
696
+ }, lr = ({
697
+ fieldTitle: e,
698
+ optional: r,
699
+ elementCssClass: n,
700
+ elementId: s,
701
+ errorText: o,
702
+ ...a
703
+ }) => /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
704
+ /* @__PURE__ */ t(
705
+ A,
706
+ {
707
+ fieldTitle: e,
708
+ optional: r,
709
+ htmlFor: s
710
+ }
711
+ ),
712
+ /* @__PURE__ */ t(
713
+ Ge,
714
+ {
715
+ cssClass: n,
716
+ elementId: s,
717
+ invalid: !!o,
718
+ ...a
719
+ }
720
+ ),
721
+ /* @__PURE__ */ t(P, { errorText: o })
722
+ ] });
678
723
  export {
679
724
  y as AlertVariant,
680
725
  k as ButtonVariant,
681
- Ze as DialAlert,
682
- we as DialButton,
683
- Ye as DialCheckbox,
684
- V as DialErrorText,
685
- _ as DialFieldLabel,
686
- N as DialIcon,
726
+ Qe as DialAlert,
727
+ De as DialButton,
728
+ rr as DialCheckbox,
729
+ P as DialErrorText,
730
+ A as DialFieldLabel,
731
+ C as DialIcon,
687
732
  E as DialInput,
688
- Xe as DialLoader,
689
- Je as DialNumberInputField,
690
- qe as DialSteps,
691
- rr as DialSwitch,
692
- er as DialTextAreaField,
693
- Qe as DialTextInputField,
694
- _e as DialTextarea,
733
+ er as DialLoader,
734
+ nr as DialNumberInputField,
735
+ Ge as DialPasswordInput,
736
+ lr as DialPasswordInputField,
737
+ tr as DialSteps,
738
+ ar as DialSwitch,
739
+ or as DialTextAreaField,
740
+ sr as DialTextInputField,
741
+ We as DialTextarea,
695
742
  I as DialTooltip,
696
743
  p as StepStatus
697
744
  };
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ interface Props {
3
+ onClick: () => void;
4
+ }
5
+ /**
6
+ * An icon button component for hiding password input (eye-off icon).
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <DialHideIcon onClick={() => setShowPassword(false)} />
11
+ * ```
12
+ *
13
+ * @param onClick - Callback function called when the icon is clicked
14
+ */
15
+ export declare const DialHideIcon: FC<Props>;
16
+ export {};
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ interface Props {
3
+ onClick: () => void;
4
+ }
5
+ /**
6
+ * An icon button component for showing password input (eye icon).
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <DialShowIcon onClick={() => setShowPassword(true)} />
11
+ * ```
12
+ *
13
+ * @param onClick - Callback function called when the icon is clicked
14
+ */
15
+ export declare const DialShowIcon: FC<Props>;
16
+ export {};
@@ -0,0 +1,24 @@
1
+ import { FC } from 'react';
2
+ import { DialInputProps } from '../Input/Input';
3
+ /**
4
+ * A password input component with show/hide functionality and customizable props.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <DialPasswordInput
9
+ * id="password"
10
+ * label="Password"
11
+ * value={password}
12
+ * onChange={e => setPassword(e.target.value)}
13
+ * disabled={false}
14
+ * />
15
+ * ```
16
+ *
17
+ * @param id - Unique identifier for the input element
18
+ * @param [label] - The label text for the field
19
+ * @param [value] - The current value of the input
20
+ * @param [onChange] - Callback function called when the input value changes
21
+ * @param [disabled=false] - Whether the input is disabled
22
+ * @param [iconAfterInput] - Custom icon to display after the input (overridden by show/hide icons)
23
+ */
24
+ export declare const DialPasswordInput: FC<DialInputProps>;
@@ -0,0 +1,29 @@
1
+ import { FC } from 'react';
2
+ import { DialInputFieldBaseProps } from '../InputField/InputField';
3
+ export interface DialPasswordInputFieldProps extends DialInputFieldBaseProps {
4
+ onChange?: (value: string) => void;
5
+ }
6
+ /**
7
+ * A password input field component with label, error text, and show/hide functionality.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <DialPasswordInputField
12
+ * elementId="password"
13
+ * fieldTitle="Password"
14
+ * value={password}
15
+ * onChange={setPassword}
16
+ * errorText={error}
17
+ * optional={false}
18
+ * />
19
+ * ```
20
+ *
21
+ * @param elementId - Unique identifier for the input element
22
+ * @param [fieldTitle] - The label text for the field
23
+ * @param [value] - The current value of the input
24
+ * @param [onChange] - Callback function called when the input value changes
25
+ * @param [errorText] - Error message to display below the input
26
+ * @param [optional=false] - Whether the field is optional
27
+ * @param [cssClass] - Custom CSS class for the input element
28
+ */
29
+ export declare const DialPasswordInputField: FC<DialPasswordInputFieldProps>;
@@ -4,6 +4,6 @@ export interface DialStepProps {
4
4
  step: Step;
5
5
  index: number;
6
6
  currentStep: string;
7
- handleStepChange: (step: string) => void;
7
+ onChangeStep: (step: string) => void;
8
8
  }
9
9
  export declare const DialStep: FC<DialStepProps>;
@@ -3,7 +3,7 @@ import { Step } from '../../models/step';
3
3
  export interface DialStepsProps {
4
4
  steps: Step[];
5
5
  currentStep: string;
6
- setCurrentStep: (step: string) => void;
6
+ onChangeStep: (step: string) => void;
7
7
  }
8
8
  /**
9
9
  * Props for the DialSteps component, which renders a multi-step navigation UI.
@@ -13,12 +13,12 @@ export interface DialStepsProps {
13
13
  * <DialSteps
14
14
  * steps={[{ id: 'step1', label: 'Step 1', status: StepStatus.VALID }, { id: 'step2', label: 'Step 2', status: StepStatus.ERROR }]}
15
15
  * currentStep="step1"
16
- * setCurrentStep={(step) => console.log(step)}
16
+ * onChangeStep={(step) => console.log(step)}
17
17
  * />
18
18
  * ```
19
19
  *
20
20
  * @param steps - Array of step objects to display
21
21
  * @param currentStep - The id of the currently active step
22
- * @param setCurrentStep - Callback to set the current step by id
22
+ * @param onChangeStep - Callback to set the current step by id
23
23
  */
24
24
  export declare const DialSteps: FC<DialStepsProps>;
@@ -13,6 +13,8 @@ export { DialSwitch } from './components/Switch/Switch';
13
13
  export { DialInput } from './components/Input/Input';
14
14
  export { DialNumberInputField } from './components/InputField/InputField';
15
15
  export { DialTextInputField } from './components/InputField/InputField';
16
+ export { DialPasswordInputField } from './components/PasswordInput/PasswordInputField';
17
+ export { DialPasswordInput } from './components/PasswordInput/PasswordInput';
16
18
  export { AlertVariant } from './types/alert';
17
19
  export { ButtonVariant } from './types/button';
18
20
  export { StepStatus } from './models/step';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.2.0-rc.10",
3
+ "version": "0.2.0-rc.12",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",