@epam/ai-dial-ui-kit 0.2.0-rc.3 → 0.2.0-rc.30

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.
Files changed (48) hide show
  1. package/dist/dial-ui-kit.cjs.js +1 -1
  2. package/dist/dial-ui-kit.es.js +1082 -328
  3. package/dist/index.css +2 -2
  4. package/dist/src/components/Alert/Alert.d.ts +6 -6
  5. package/dist/src/components/Alert/constants.d.ts +1 -1
  6. package/dist/src/components/AutocompleteInput/AutocompleteInput.d.ts +36 -0
  7. package/dist/src/components/AutocompleteInput/AutocompleteInputValue.d.ts +26 -0
  8. package/dist/src/components/Button/Button.d.ts +7 -2
  9. package/dist/src/components/Button/constants.d.ts +2 -0
  10. package/dist/src/components/Checkbox/Checkbox.d.ts +33 -0
  11. package/dist/src/components/CloseButton/CloseButton.d.ts +26 -0
  12. package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +37 -0
  13. package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +53 -0
  14. package/dist/src/components/ConfirmationPopup/constants.d.ts +11 -0
  15. package/dist/src/components/Input/Input.d.ts +4 -4
  16. package/dist/src/components/InputField/InputField.d.ts +4 -4
  17. package/dist/src/components/LabelledText/LabelledText.d.ts +25 -0
  18. package/dist/src/components/Loader/Loader.d.ts +32 -0
  19. package/dist/src/components/Loader/constants.d.ts +2 -0
  20. package/dist/src/components/NoDataContent/NoDataContent.d.ts +22 -0
  21. package/dist/src/components/PasswordInput/Icons/HideIcon.d.ts +16 -0
  22. package/dist/src/components/PasswordInput/Icons/ShowIcon.d.ts +16 -0
  23. package/dist/src/components/PasswordInput/PasswordInput.d.ts +24 -0
  24. package/dist/src/components/PasswordInput/PasswordInputField.d.ts +29 -0
  25. package/dist/src/components/Popup/Popup.d.ts +52 -0
  26. package/dist/src/components/Popup/constants.d.ts +6 -0
  27. package/dist/src/components/RadioButton/RadioButton.d.ts +46 -0
  28. package/dist/src/components/RadioGroup/RadioGroup.d.ts +47 -0
  29. package/dist/src/components/RadioGroup/constants.d.ts +5 -0
  30. package/dist/src/components/Search/Search.d.ts +42 -0
  31. package/dist/src/components/Search/constants.d.ts +14 -0
  32. package/dist/src/components/Steps/Step.d.ts +9 -0
  33. package/dist/src/components/Steps/Steps.d.ts +24 -0
  34. package/dist/src/components/Steps/tests/Steps.test.d.ts +1 -0
  35. package/dist/src/components/Steps/utils.d.ts +3 -0
  36. package/dist/src/components/Switch/Switch.d.ts +1 -1
  37. package/dist/src/components/TextAreaField/TextAreaField.d.ts +2 -2
  38. package/dist/src/constants/icon.d.ts +5 -0
  39. package/dist/src/index.d.ts +25 -1
  40. package/dist/src/models/field-control-props.d.ts +2 -2
  41. package/dist/src/models/radio.d.ts +6 -0
  42. package/dist/src/models/step.d.ts +9 -0
  43. package/dist/src/types/button.d.ts +6 -0
  44. package/dist/src/types/confirmation-popup.d.ts +4 -0
  45. package/dist/src/types/popup.d.ts +5 -0
  46. package/dist/src/types/radio-group.d.ts +4 -0
  47. package/dist/src/types/search.d.ts +4 -0
  48. package/package.json +11 -10
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("classnames"),y=require("@tabler/icons-react"),u=require("@floating-ui/react"),f=require("react"),N=({icon:e,className:r})=>e?s.jsx("span",{className:d("flex-shrink-0",r),children:e}):null,A=({title:e,cssClass:r,ref:t,onClick:n,disable:l,iconAfter:o,iconBefore:a,hideTitleOnMobile:c,ariaLabel:i})=>{const p=d("dial-small-semi",o?"mr-2":"",a?"ml-2":"",c?"hidden sm:inline":"inline"),x=d(r,"focus-visible:outline outline-offset-0");return s.jsxs("button",{ref:t,type:"button",className:x,onClick:m=>n?.(m),disabled:l,"aria-label":e||i,children:[s.jsx(N,{icon:a}),e&&s.jsx("span",{className:p,children:e}),s.jsx(N,{icon:o})]})},k=({errorText:e})=>e&&s.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),S=({fieldTitle:e,htmlFor:r,optional:t,optionalText:n,cssClass:l})=>e?s.jsxs("label",{className:d("dial-tiny text-secondary",l,!l?.includes("mb")&&"mb-2"),htmlFor:r,children:[s.jsx("span",{className:"min-h-4",children:e}),t&&s.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null;var j=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(j||{});const _={info:s.jsx(y.IconInfoCircle,{size:24}),error:s.jsx(y.IconAlertCircle,{size:24}),warning:s.jsx(y.IconAlertTriangle,{size:24}),success:s.jsx(y.IconCircleCheck,{size:24})},B={[j.Info]:"bg-info border-info text-info",[j.Success]:"bg-success border-success text-success",[j.Warning]:"bg-warning border-warning text-warning",[j.Error]:"bg-error border-error text-error"},K="inline-flex items-center justify-between gap-2 px-3 py-2 border border-solid shadow text-sm w-auto rounded",O=({variant:e=j.Info,message:r,cssClass:t,closable:n=!0,onClose:l})=>s.jsxs("div",{role:"alert",className:d(K,B[e],t),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(N,{icon:_[e]}),s.jsx("div",{className:"text-primary",children:r})]}),n&&s.jsx(A,{cssClass:"ml-2 text-secondary hover:text-primary ml-2 text-secondary hover:text-primary ",ariaLabel:"Close alert",iconBefore:s.jsx(y.IconX,{size:16}),onClick:o=>l?.(o)})]}),$=7,G=2,z=f.createContext(null),W=()=>{const e=f.useContext(z);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},X=({initialOpen:e=!1,placement:r="bottom",isTriggerClickable:t=!1,open:n,onOpenChange:l}={})=>{const[o,a]=f.useState(e),c=f.useRef(null),i=n??o,p=l??a,x=u.useFloating({placement:r,open:i,onOpenChange:p,whileElementsMounted:u.autoUpdate,middleware:[u.offset($+G),u.flip({crossAxis:r.includes("-"),fallbackAxisSideDirection:"start",padding:5}),u.shift({padding:5}),u.arrow({element:c})]}),m=u.useHover(x.context,{move:!1,enabled:n==null,mouseOnly:t,delay:{open:500,close:0}}),I=u.useFocus(x.context,{enabled:n==null}),R=u.useDismiss(x.context),b=u.useRole(x.context,{role:"tooltip"}),g=u.useInteractions([m,I,R,b]);return f.useMemo(()=>({open:i,setOpen:p,arrowRef:c,...g,...x}),[i,p,g,x])},Y=({children:e,...r})=>{const t=X(r);return s.jsx(z.Provider,{value:t,children:e})},Z=f.forwardRef(function({style:r,...t},n){const l=W(),o=u.useMergeRefs([l.refs.setFloating,n]);return l.open?s.jsx(u.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...l.floatingStyles,...r},...l.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]",l.getFloatingProps(t).className),children:[t.children,s.jsx(u.FloatingArrow,{ref:l.arrowRef,context:l.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),J=f.forwardRef(function({children:r,asChild:t=!1,...n},l){const o=W(),c=r&&typeof r=="object"&&"ref"in r&&r.ref!==void 0?r.ref:void 0,i=u.useMergeRefs([o.refs.setReference,l,c]);return t&&f.isValidElement(r)?f.cloneElement(r,o.getReferenceProps({ref:i,...n,...r.props})):s.jsx("span",{ref:i,...o.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:r})}),D=({hideTooltip:e,tooltip:r,children:t,triggerClassName:n,contentClassName:l,...o})=>e||!r?s.jsx("span",{className:n,children:t}):s.jsxs(Y,{...o,children:[s.jsx(J,{className:d(n,"truncate"),children:t}),s.jsx(Z,{className:d("text-primary",l,"max-w-[300px]",(e||!r)&&"hidden"),children:r})]}),L=({value:e,textareaId:r,placeholder:t,cssClass:n="",disabled:l,invalid:o,readonly:a,onChange:c})=>s.jsx(D,{tooltip:e,triggerClassName:"flex",children:s.jsx("textarea",{id:r,placeholder:t,value:e||"",disabled:l,className:d("dial-textarea dial-input",o?"dial-input-error":"",l&&"dial-input-disable",a&&"dial-input-readonly",n),onChange:i=>!a&&c?.(i.currentTarget.value)})}),Q=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],ee=(e,r,t,n)=>{if((r==="number"||t!==void 0||n!==void 0)&&!Q.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(t===void 0||t<0))&&!(e.key==="."&&r==="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,a=e.currentTarget.selectionStart||0,c=o.slice(0,a)+e.key+o.slice(a),i=parseFloat(c);if(!isNaN(i)){if(t!==void 0&&i<t){e.preventDefault();return}if(n!==void 0&&i>n){e.preventDefault();return}}}}},F=({iconBeforeInput:e,iconAfterInput:r,hideBorder:t,value:n,elementId:l,placeholder:o="",cssClass:a="",containerCssClass:c,tooltipTriggerClassName:i,type:p="text",disabled:x,readonly:m,invalid:I,onChange:R,min:b,max:g,prefix:E,suffix:P,textBeforeInput:v,textAfterInput:w})=>{const q=h=>h.target.blur(),H=p==="number"||b!==void 0||g!==void 0,U=h=>{ee(h,p,b,g)},V=h=>{const C=h.currentTarget.value;if(H&&C!==""){const T=parseFloat(C);if(isNaN(T)&&C!=="-"&&C!=="."||!isNaN(T)&&(b!==void 0&&T<b||g!==void 0&&T>g))return}R?.(C)};return s.jsxs("div",{className:d("dial-input-field flex flex-row items-center justify-between",t?"dial-input-no-border":"dial-input",I&&"dial-input-error",x&&"dial-input-disable",m&&"dial-input-readonly",!v&&"pl-1",!w&&"pr-1",c),children:[v&&s.jsx(D,{tooltip:v,children:s.jsx(F,{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"})}),E&&s.jsxs("p",{className:"text-secondary dial-small pl-2",children:[" ",E]}),s.jsx(N,{icon:e,className:"pl-2"}),s.jsx(D,{tooltip:n,triggerClassName:i,children:s.jsx("input",{type:p,autoComplete:"off",id:l,placeholder:o,value:n??"",title:n?String(n):"",disabled:x,className:d("border-0 bg-transparent px-2",a),onChange:h=>!m&&V?.(h),onKeyDown:U,onWheel:q,min:b,max:g})}),s.jsx(N,{icon:r,className:"pr-2"}),P&&s.jsxs("p",{className:"text-secondary dial-small pr-2",children:[" ",P]}),w&&s.jsx(D,{tooltip:w,children:s.jsx(F,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",cssClass:"px-2",value:w,disabled:!0,elementId:w+"textAfter"})})]})},se=/^0+\.(\d+)?$/,re=/^0+/,M=({fieldTitle:e,errorText:r,optional:t,elementCssClass:n,elementContainerCssClass:l,elementId:o,containerCssClass:a,readonly:c,defaultEmptyText:i,min:p,max:x,...m})=>s.jsxs("div",{className:d("flex flex-col",a),children:[s.jsx(S,{fieldTitle:e,optional:t,htmlFor:o}),c?s.jsx("span",{children:m.value||(i??"None")}):s.jsxs(s.Fragment,{children:[s.jsx(F,{elementId:o,cssClass:n,containerCssClass:l,invalid:r!=null,min:p,max:x,...m}),s.jsx(k,{errorText:r})]})]}),te=({onChange:e,value:r,min:t,max:n,...l})=>{const o=a=>String(a)?.match(se)?String(a)?.replace(re,"0"):Number(a);return s.jsx(M,{type:"number",onChange:a=>e?.(o(a)),value:r,min:t,max:n,...l})},ne=({onChange:e,...r})=>s.jsx(M,{type:"text",onChange:t=>e?.(t),...r}),le=({fieldTitle:e,optional:r,elementId:t,elementCssClass:n,errorText:l,...o})=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(S,{fieldTitle:e,optional:r,htmlFor:t}),s.jsx(L,{textareaId:t,cssClass:n,...o}),s.jsx(k,{errorText:l})]}),oe=({title:e,switchId:r,isOn:t=!1,disabled:n,onChange:l})=>{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"),a=f.useCallback(c=>{c.stopPropagation(),l?.(!t)},[l,t]);return s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx("input",{type:"checkbox",onChange:a,id:r,disabled:n,className:"invisible w-0 h-0",checked:t}),s.jsx("label",{htmlFor:r,className:o,children:s.jsx("span",{className:d("size-3 rounded-full",n?t?"bg-controls-disable":"bg-layer-4":"bg-controls-enable-primary")})}),e&&s.jsx("span",{className:"h-[14px] pl-2 small text-primary",children:e})]})};exports.AlertVariant=j;exports.DialAlert=O;exports.DialButton=A;exports.DialErrorText=k;exports.DialFieldLabel=S;exports.DialIcon=N;exports.DialInput=F;exports.DialNumberInputField=te;exports.DialSwitch=oe;exports.DialTextAreaField=le;exports.DialTextInputField=ne;exports.DialTextarea=L;exports.DialTooltip=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("classnames"),b=require("@tabler/icons-react"),m=require("react"),h=require("@floating-ui/react");function ae(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const k=ae(m),_=({errorText:e})=>e&&s.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),B=({fieldTitle:e,htmlFor:r,optional:t,optionalText:n,cssClass:a})=>e?s.jsxs("label",{className:i("dial-tiny text-secondary",a,!a?.includes("mb")&&"mb-2"),htmlFor:r,children:[s.jsx("span",{className:"min-h-4",children:e}),t&&s.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null,D=({icon:e,className:r})=>e?s.jsx("span",{className:i("flex-shrink-0",r),children:e}):null;var v=(e=>(e.Primary="primary",e.Secondary="secondary",e.Tertiary="tertiary",e.Danger="danger",e))(v||{});const oe={[v.Primary]:"dial-primary-button",[v.Secondary]:"dial-secondary-button",[v.Tertiary]:"dial-tertiary-button",[v.Danger]:"dial-danger-button"},T=({title:e,variant:r,cssClass:t,textCssClass:n,ref:a,onClick:o,disable:l,iconAfter:u,iconBefore:d,hideTitleOnMobile:c,ariaLabel:x})=>{const p=i("dial-small-semi",u?"mr-2":"",d?"ml-2":"",c?"hidden sm:inline":"inline",n),g=i(r&&oe[r],t,"focus-visible:outline outline-offset-0");return s.jsxs("button",{ref:a,type:"button",className:g,onClick:f=>o?.(f),disabled:l,"aria-label":e||x,children:[s.jsx(D,{icon:d}),e&&s.jsx("span",{className:p,children:e}),s.jsx(D,{icon:u})]})};var R=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(R||{});const le={info:s.jsx(b.IconInfoCircle,{size:24,stroke:2}),error:s.jsx(b.IconAlertCircle,{size:24,stroke:2}),warning:s.jsx(b.IconAlertTriangle,{size:24,stroke:2}),success:s.jsx(b.IconCircleCheck,{size:24,stroke:2})},ie={[R.Info]:"bg-info border-info text-info",[R.Success]:"bg-success border-success text-success",[R.Warning]:"bg-warning border-warning text-warning",[R.Error]:"bg-error border-error text-error"},ce="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",de=({variant:e=R.Info,message:r,cssClass:t,closable:n=!1,onClose:a})=>s.jsxs("div",{role:"alert",className:i(ce,ie[e],t),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(D,{icon:le[e]}),s.jsx("div",{className:"text-primary",children:r})]}),n&&s.jsx(T,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:s.jsx(b.IconX,{size:16}),onClick:o=>a?.(o)})]}),ue="flex items-center justify-center text-secondary",xe="shrink-0 grow-0 basis-auto animate-spin-steps",pe=e=>k.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},k.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),q=({size:e=18,cssClass:r,iconClass:t,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status","aria-label":a,name:"loader",className:i({[ue]:!0,"w-full h-full":n,[r||""]:!!r}),children:s.jsx(D,{icon:s.jsx(pe,{width:e,height:e,className:i(xe,t),role:"img"})})}),me=7,fe=2,G=m.createContext(null),$=()=>{const e=m.useContext(G);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},he=({initialOpen:e=!1,placement:r="bottom",isTriggerClickable:t=!1,open:n,onOpenChange:a}={})=>{const[o,l]=m.useState(e),u=m.useRef(null),d=n??o,c=a??l,x=h.useFloating({placement:r,open:d,onOpenChange:c,whileElementsMounted:h.autoUpdate,middleware:[h.offset(me+fe),h.flip({crossAxis:r.includes("-"),fallbackAxisSideDirection:"start",padding:5}),h.shift({padding:5}),h.arrow({element:u})]}),p=h.useHover(x.context,{move:!1,enabled:n==null,mouseOnly:t,delay:{open:500,close:0}}),g=h.useFocus(x.context,{enabled:n==null}),f=h.useDismiss(x.context),C=h.useRole(x.context,{role:"tooltip"}),j=h.useInteractions([p,g,f,C]);return m.useMemo(()=>({open:d,setOpen:c,arrowRef:u,...j,...x}),[d,c,j,x])},ge=({children:e,...r})=>{const t=he(r);return s.jsx(G.Provider,{value:t,children:e})},je=m.forwardRef(function({style:r,...t},n){const a=$(),o=h.useMergeRefs([a.refs.setFloating,n]);return a.open?s.jsx(h.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:o,style:{...a.floatingStyles,...r},...a.getFloatingProps(t),className:i("z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",a.getFloatingProps(t).className),children:[t.children,s.jsx(h.FloatingArrow,{ref:a.arrowRef,context:a.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),be=m.forwardRef(function({children:r,asChild:t=!1,...n},a){const o=$(),u=r&&typeof r=="object"&&"ref"in r&&r.ref!==void 0?r.ref:void 0,d=h.useMergeRefs([o.refs.setReference,a,u]);return t&&m.isValidElement(r)?m.cloneElement(r,o.getReferenceProps({ref:d,...n,...r.props})):s.jsx("span",{ref:d,...o.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:r})}),E=({hideTooltip:e,tooltip:r,children:t,triggerClassName:n,contentClassName:a,...o})=>s.jsxs(ge,{...o,children:[s.jsx(be,{className:i(n,"truncate"),children:t}),s.jsx(je,{className:i("text-primary",a,"max-w-[300px]",(e||!r)&&"hidden"),children:r})]}),K=18,F={size:K,stroke:2},ye=({label:e,id:r,checked:t,indeterminate:n,disabled:a,ariaLabel:o,onChange:l})=>{const u=m.useCallback(x=>{x.stopPropagation(),l?.(x.target.checked,r)},[l,r]),d=i("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":""),c=i("mr-2 border rounded",a?"bg-layer-4 border-icon-secondary":"");return s.jsxs("label",{className:d,htmlFor:r,children:[t&&(n?s.jsx(b.IconMinus,{className:c,...F}):s.jsx(b.IconCheck,{className:c,...F})),e&&s.jsx(E,{tooltip:e,triggerClassName:"flex-1 min-w-0",children:s.jsx("p",{className:"text-primary w-full truncate",children:e})}),s.jsx("input",{type:"checkbox",onChange:u,id:r,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 w=(e=>(e.VALID="valid",e.ERROR="error",e))(w||{});const Ce=(e,r)=>{if(r===e.id)switch(e.status){case w.VALID:return"border-accent-secondary text-primary";case w.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(e.status){case w.VALID:return"border-primary text-white";case w.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},we=(e,r)=>{if(r===e.id)switch(e.status){case w.VALID:return"bg-accent-secondary";case w.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(e.status){case w.VALID:return"bg-accent-secondary";case w.ERROR:return"bg-red-400";default:return"bg-layer-4"}},ve=({step:e,index:r,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===w.ERROR?s.jsx(b.IconExclamationCircle,{stroke:2,size:16}):t!==e.id&&e.status===w.VALID?s.jsx(b.IconCheck,{stroke:2,size:16}):r+1;return s.jsxs("button",{className:i(a,Ce(e,t)),onClick:()=>n(e.id),children:[s.jsx("span",{className:i(o,we(e,t)),children:l()}),s.jsx("span",{children:e.name})]})},Ne=({steps:e,currentStep:r,onChangeStep:t})=>{const n=a=>{const o=e.findIndex(u=>u.id===r),l=e.findIndex(u=>u.id===a);(a!==r&&e[o].status===w.VALID||l<o)&&t(a)};return s.jsx("div",{id:"steps",className:"flex gap-x-3",children:e.map((a,o)=>s.jsx(ve,{currentStep:r,onChangeStep:n,step:a,index:o},a.id))})},U=({name:e,value:r,title:t,description:n,checked:a=!1,inputId:o,cssClass:l,labelCssClass:u,disabled:d,onChange:c,descriptionCssClass:x})=>{const p=`${o}-desc`,g=i("dial-small cursor-pointer",d?"text-secondary":"text-primary",u),f=i("cursor-pointer dial-input-radio",t&&"mr-2",l),C=i("flex flex-col",!!n&&"mb-2"),j=i("dial-tiny mt-2 ml-[26px] text-secondary",x),N=I=>{d||I.target.checked&&c?.(r)};return s.jsxs("div",{className:C,children:[s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx("input",{type:"radio",id:o,name:e,value:r,checked:a,disabled:d,"aria-describedby":a&&n?p:void 0,className:f,onChange:N}),t?s.jsx("label",{className:g,htmlFor:o,children:t}):null]}),a&&n&&s.jsx("div",{id:p,className:j,children:n})]})};var W=(e=>(e.Row="Row",e.Column="Column",e))(W||{});const ke="flex flex-col gap-2",De="flex",Ie="pb-1 mt-2",Se={[W.Column]:"flex-col gap-y-3",[W.Row]:"flex-row gap-x-6"},Re=({fieldTitle:e,radioCssClass:r,labelCssClass:t,disabled:n,elementId:a,radioButtons:o,activeRadioButton:l,orientation:u,onChange:d})=>s.jsxs("div",{className:ke,children:[e&&s.jsx(B,{fieldTitle:e,htmlFor:a}),s.jsx("div",{role:"radiogroup","aria-label":e,"aria-disabled":n||void 0,className:i(De,Se[u]),children:o.map(c=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(U,{name:a,value:c.id,inputId:c.id,disabled:n,cssClass:r,labelCssClass:t,title:c.name,checked:c.id===l,onChange:()=>d(c.id)}),c.id===l&&c.content?s.jsx("div",{className:Ie,children:c.content}):null]},c.id))})]}),Le=({icon:e,title:r,description:t})=>s.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center text-secondary",children:[e||s.jsx(b.IconClipboardX,{width:60,height:60}),s.jsx("span",{className:"small mt-2 text-primary",children:r}),t&&s.jsx("span",{className:"mt-1 text-primary",children:t})]}),Ee=60,Te=({containerCssClass:e,children:r,width:t,title:n,iconSize:a=K,titleCssClass:o,additionalButtons:l})=>{const[u,d]=m.useState(t),[c,x]=m.useState(!0),p=i(["transform rotate-180 [writing-mode:tb-rl]",c&&"hidden",o]),g=i(["flex flex-row gap-2 cursor-pointer text-secondary",c?"justify-end":"justify-center"]),f=()=>{d(c?Ee:t),x(!c)};return s.jsxs("div",{className:i(["rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",e]),style:{width:`${u}px`},children:[s.jsx("div",{className:i(["flex-1 min-h-0 overflow-auto",!c&&"hidden"]),children:r}),s.jsx("div",{className:p,children:n}),s.jsxs("div",{className:g,children:[c&&l,s.jsx(T,{cssClass:"hover:text-icon-accent-primary",onClick:f,iconBefore:c?s.jsx(b.IconChevronsLeft,{size:a,stroke:F.stroke}):s.jsx(b.IconChevronsRight,{size:a,stroke:F.stroke})})]})]})},Fe=({label:e,text:r,children:t,postfix:n})=>s.jsxs("div",{className:i("flex flex-col text-secondary",t?"":"max-w-[200px]"),children:[s.jsx("label",{className:"dial-tiny mb-2",children:e}),t||s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx(E,{triggerClassName:"text-primary",tooltip:r,children:r}),n||null]})]}),X=({ariaLabel:e,cssClass:r,size:t=24,onClose:n})=>s.jsx(T,{ariaLabel:e,cssClass:i("text-secondary hover:text-accent-primary",r),onClick:n,iconBefore:s.jsx(b.IconX,{size:t})}),Z=({value:e,textareaId:r,placeholder:t,cssClass:n="",disabled:a,invalid:o,readonly:l,onChange:u})=>s.jsx(E,{tooltip:e,triggerClassName:"flex",children:s.jsx("textarea",{id:r,placeholder:t,value:e||"",disabled:a,className:i("dial-textarea dial-input px-3 py-2",o?"dial-input-error":"",a&&"dial-input-disable",l&&"dial-input-readonly",n),onChange:d=>!l&&u?.(d.currentTarget.value)})}),Pe=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],Ae=(e,r,t,n)=>{if((r==="number"||t!==void 0||n!==void 0)&&!Pe.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(t===void 0||t<0))&&!(e.key==="."&&r==="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,u=o.slice(0,l)+e.key+o.slice(l),d=parseFloat(u);if(!isNaN(d)){if(t!==void 0&&d<t){e.preventDefault();return}if(n!==void 0&&d>n){e.preventDefault();return}}}}},A=({iconBefore:e,iconAfter:r,hideBorder:t,value:n,elementId:a,placeholder:o="",cssClass:l="",containerCssClass:u,tooltipTriggerClassName:d,type:c="text",disabled:x,readonly:p,invalid:g,onChange:f,min:C,max:j,prefix:N,suffix:I,textBeforeInput:y,textAfterInput:V})=>{const se=S=>S.target.blur(),re=c==="number"||C!==void 0||j!==void 0,te=S=>{Ae(S,c,C,j)},ne=S=>{const P=S.currentTarget.value;if(re&&P!==""){const z=parseFloat(P);if(isNaN(z)&&P!=="-"&&P!=="."||!isNaN(z)&&(C!==void 0&&z<C||j!==void 0&&z>j))return}f?.(P)};return s.jsxs("div",{className:i("dial-input-field flex flex-row items-center justify-between py-2",t?"dial-input-no-border":"dial-input",g&&"dial-input-error",x&&"dial-input-disable",p&&"dial-input-readonly",!y&&"pl-3",!V&&"pr-3",u),children:[y&&s.jsx("div",{children:s.jsx(A,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"overflow-hidden overflow-ellipsis dial-small",value:y,disabled:!0,elementId:y+"textBefore"})}),N&&s.jsxs("p",{className:"text-secondary dial-small",children:[" ",N]}),s.jsx(D,{icon:e}),s.jsx(E,{tooltip:n,triggerClassName:i(d,"flex-1"),children:s.jsx("input",{type:c,autoComplete:"off",id:a,placeholder:o,value:n??"",disabled:x,className:i("border-0 bg-transparent",l),onChange:S=>!p&&ne?.(S),onKeyDown:te,onWheel:se,min:C,max:j})}),s.jsx(D,{icon:r}),I&&s.jsxs("p",{className:"text-secondary dial-small",children:[" ",I]}),V&&s.jsx("div",{children:s.jsx(A,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",value:V,disabled:!0,elementId:V+"textAfter"})})]})},Oe=/^0+\.(\d+)?$/,Me=/^0+/,Q=({fieldTitle:e,errorText:r,optional:t,elementCssClass:n,elementContainerCssClass:a,elementId:o,containerCssClass:l,readonly:u,defaultEmptyText:d,min:c,max:x,...p})=>s.jsxs("div",{className:i("flex flex-col",l),children:[s.jsx(B,{fieldTitle:e,optional:t,htmlFor:o}),u?s.jsx("span",{children:p.value||(d??"None")}):s.jsxs(s.Fragment,{children:[s.jsx(A,{elementId:o,cssClass:n,containerCssClass:a,invalid:r!=null,min:c,max:x,...p}),s.jsx(_,{errorText:r})]})]}),Be=({onChange:e,value:r,min:t,max:n,...a})=>{const o=l=>String(l)?.match(Oe)?String(l)?.replace(Me,"0"):Number(l);return s.jsx(Q,{type:"number",onChange:l=>e?.(o(l)),value:r,min:t,max:n,...a})},Ve=({onChange:e,...r})=>s.jsx(Q,{type:"text",onChange:t=>e?.(t),...r}),ze=({fieldTitle:e,optional:r,elementId:t,elementCssClass:n,errorText:a,...o})=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(B,{fieldTitle:e,optional:r,htmlFor:t}),s.jsx(Z,{textareaId:t,cssClass:n,...o}),s.jsx(_,{errorText:a})]}),We=({title:e,switchId:r,isOn:t=!1,disabled:n,onChange:a})=>{const o=i("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(u=>{u.stopPropagation(),a?.(!t)},[a,t]);return s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx("input",{type:"checkbox",onChange:l,id:r,disabled:n,className:"invisible w-0 h-0",checked:t}),s.jsx("label",{htmlFor:r,className:o,children:s.jsx("span",{className:i("size-3 rounded-full",n?t?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&s.jsx("span",{className:"pl-2 dial-small text-primary",children:e})]})};var L=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(L||{});const _e="z-[52] flex items-center justify-center bg-blackout md:p-4",He="relative max-h-full rounded bg-layer-3 flex flex-col shadow w-full h-full md:h-auto",qe="divide-tertiary divide-y",Ge="flex flex-row justify-between py-4 px-6 items-center",$e={[L.Sm]:"max-w-full md:max-w-[400px]",[L.Md]:"max-w-full md:max-w-[800px]",[L.Lg]:"max-w-full md:max-w-[1200px]"},Y=({open:e=!1,title:r,portalId:t,cssClass:n,overlayClass:a,headingClass:o,dividers:l=!0,children:u,footer:d,onClose:c,size:x=L.Md})=>{const{refs:p,context:g}=h.useFloating({open:e,onOpenChange:y=>{y||c?.(null)}}),f=h.useRole(g,{role:"dialog"}),C=h.useDismiss(g,{outsidePress:!0}),{getFloatingProps:j}=h.useInteractions([f,C]);if(!e)return null;const N=typeof r=="string"?"dial-popup-heading":void 0,I=y=>y?typeof y=="string"?s.jsx("h3",{id:N,className:i("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",o),children:s.jsx(E,{tooltip:y,children:y})}):y:s.jsx("span",{});return s.jsx(h.FloatingPortal,{id:t,children:s.jsx(h.FloatingOverlay,{className:i(_e,a),children:s.jsx(h.FloatingFocusManager,{context:g,children:s.jsxs("div",{ref:p.setFloating,...j(),role:"dialog","aria-modal":"true","aria-labelledby":N,className:i(He,$e[x],l&&qe,n),children:[s.jsxs("div",{className:Ge,children:[I(r),s.jsx(X,{ariaLabel:"Close dialog",onClose:y=>c?.(y)})]}),s.jsx("div",{className:"flex-grow overflow-auto",children:u}),d]})})})})};var O=(e=>(e.Info="info",e.Danger="danger",e))(O||{});const Ke="flex justify-end gap-2 px-6 py-4",Ue="text-secondary dial-small-150 px-6 py-4",Xe="Cancel",H={[O.Info]:{confirmVariant:v.Primary,cancelVariant:v.Secondary},[O.Danger]:{container:"border-t-4 border-error",confirmVariant:v.Danger,cancelVariant:v.Secondary}},Ze=({title:e,description:r,descriptionCssClass:t,open:n=!1,confirmLabel:a,cancelLabel:o=Xe,isLoading:l=!1,disableConfirmButton:u=!1,cssClass:d,confirmClassName:c,onClose:x,onConfirm:p,onCancel:g,children:f,dividers:C=!1,variant:j=O.Info,size:N=L.Sm})=>{const I=l?null:s.jsxs("div",{className:Ke,children:[s.jsx(T,{variant:v.Secondary,title:o,onClick:()=>g?g():x?.()}),s.jsx(T,{variant:H[j].confirmVariant,cssClass:c,title:a,disable:u,onClick:()=>p()})]}),y=m.useCallback(()=>l?s.jsx("div",{className:"px-6 py-4 h-[120px]",children:s.jsx(q,{size:50})}):f??(r?s.jsx("div",{className:i(Ue,t),children:r}):null),[f,r,l,t]);return s.jsx(Y,{open:n,title:e,cssClass:i(H[j].container,d),dividers:C,onClose:()=>x?.(),footer:I,size:N,children:y()})},Qe=({onClick:e})=>s.jsx(b.IconEyeOff,{...F,className:"text-primary",onClick:e}),Ye=({onClick:e})=>s.jsx(b.IconEye,{...F,className:"text-primary",onClick:e}),J=({...e})=>{const[r,t]=m.useState(!1),n=m.useCallback(a=>{t(a)},[]);return s.jsx(A,{type:r?"text":"password",...e,iconAfter:r?s.jsx(Qe,{onClick:()=>n(!1)}):s.jsx(Ye,{onClick:()=>n(!0)})})},Je=({fieldTitle:e,optional:r,elementCssClass:t,elementId:n,errorText:a,...o})=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(B,{fieldTitle:e,optional:r,htmlFor:n}),s.jsx(J,{cssClass:t,elementId:n,invalid:!!a,...o}),s.jsx(_,{errorText:a})]});var M=(e=>(e.Small="small",e.Base="base",e))(M||{});const es={[M.Small]:{textClass:"text-xs px-1",containerClass:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[M.Base]:{textClass:"text-sm px-2",containerClass:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},ss=({elementId:e,value:r,placeholder:t,disabled:n,readonly:a,invalid:o,cssClass:l,containerCssClass:u,onChange:d,size:c=M.Base})=>{const[x,p]=m.useState(r||"");m.useEffect(()=>{p(r||"")},[r]);const g=m.useCallback(j=>{p(j),d?.(j)},[d]),f=es[c],C=m.useCallback(()=>{g("")},[g]);return s.jsxs("div",{className:i("dial-input flex flex-row items-center justify-between",o&&"dial-input-error",n&&"dial-input-disable",a&&"dial-input-readonly",f.containerClass,u),children:[s.jsx(D,{className:i(n?"text-secondary":"text-primary"),icon:s.jsx(b.IconSearch,{size:f.iconSize,stroke:f.iconStroke})}),s.jsx("input",{id:e,type:"text",autoComplete:"off",placeholder:t,value:x??"",disabled:n,readOnly:a,className:i("border-0 bg-transparent w-full",l,f.textClass),onChange:j=>!a&&g(j.currentTarget.value)}),x&&!a&&!n&&s.jsx(D,{className:"text-primary cursor-pointer",icon:s.jsx(b.IconX,{size:f.iconSize,stroke:f.iconStroke,onClick:C,"aria-label":"Clear search",role:"button"})})]})},ee=({selectedItems:e,listCssClass:r,listElementCssClass:t})=>!!e?.length&&s.jsx("ul",{className:i("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",r),children:e?.map(n=>s.jsx("li",{className:i(["tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",t]),children:s.jsx(E,{tooltip:n,children:s.jsx("button",{"aria-label":"autocomplete-action",type:"button",className:"truncate w-full",children:n})})},n))}),rs=({placeholder:e="",selectedItems:r=[],updateSelected:t,listCssClass:n,listElementCssClass:a,containerCssClass:o,inputCssClass:l})=>{const[u,d]=m.useState(""),c=m.useCallback(p=>{p.key==="Enter"&&(t([...r,p.currentTarget.value]),d("")),(p.key==="Backspace"||p.key==="Delete")&&r.length&&!u&&t(r.slice(0,-1))},[r,t,u]),x=m.useCallback(p=>{d(p.target.value)},[d]);return s.jsxs("div",{className:i(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",o]),children:[s.jsx(ee,{selectedItems:r,listCssClass:n,listElementCssClass:a}),s.jsx("input",{type:"text",value:u,className:i(["border-0 bg-transparent p-0",l]),placeholder:r?.length?"":e,onKeyDown:c,onChange:x})]})};exports.AlertVariant=R;exports.ButtonVariant=v;exports.ConfirmationPopupVariant=O;exports.DialAlert=de;exports.DialAutocompleteInput=rs;exports.DialAutocompleteInputValue=ee;exports.DialButton=T;exports.DialCheckbox=ye;exports.DialCloseButton=X;exports.DialCollapsibleSidebar=Te;exports.DialConfirmationPopup=Ze;exports.DialErrorText=_;exports.DialFieldLabel=B;exports.DialIcon=D;exports.DialInput=A;exports.DialLabelledText=Fe;exports.DialLoader=q;exports.DialNoDataContent=Le;exports.DialNumberInputField=Be;exports.DialPasswordInput=J;exports.DialPasswordInputField=Je;exports.DialPopup=Y;exports.DialRadioButton=U;exports.DialRadioGroup=Re;exports.DialSearch=ss;exports.DialSteps=Ne;exports.DialSwitch=We;exports.DialTextAreaField=ze;exports.DialTextInputField=Ve;exports.DialTextarea=Z;exports.DialTooltip=E;exports.PopupSize=L;exports.RadioGroupOrientation=W;exports.SearchSize=M;exports.StepStatus=w;