@epam/ai-dial-ui-kit 0.3.0-rc.5 → 0.3.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dial-ui-kit.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("classnames"),N=require("@tabler/icons-react"),f=require("react"),h=require("@floating-ui/react"),ke=require("react-dom");function De(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return t.default=s,Object.freeze(t)}const L=De(f),$=({errorText:s})=>s&&e.jsx("span",{className:"text-error dial-tiny mt-1",children:s}),W=({fieldTitle:s,htmlFor:t,optional:n,optionalText:r,cssClass:a})=>s?e.jsxs("label",{className:l("dial-tiny text-secondary",a,!a?.includes("mb")&&"mb-2"),htmlFor:t,children:[e.jsx("span",{className:"min-h-4",children:s}),n&&e.jsx("span",{className:"ml-1",children:r??"(Optional)"})]}):null,R=({icon:s,className:t})=>s?e.jsx("span",{className:l("flex-shrink-0",t),children:s}):null;var I=(s=>(s.Primary="primary",s.Secondary="secondary",s.Tertiary="tertiary",s.Danger="danger",s))(I||{});const Ie={[I.Primary]:"dial-primary-button",[I.Secondary]:"dial-secondary-button",[I.Tertiary]:"dial-tertiary-button",[I.Danger]:"dial-danger-button"},M=({title:s,variant:t,cssClass:n,textCssClass:r,ref:a,onClick:o,disable:c,iconAfter:u,iconBefore:d,hideTitleOnMobile:i,ariaLabel:x})=>{const p=l("dial-small-semi",u?"mr-2":"",d?"ml-2":"",i?"hidden sm:inline":"inline",r),j=l(t&&Ie[t],n,"focus-visible:outline outline-offset-0");return e.jsxs("button",{ref:a,type:"button",className:j,onClick:g=>o?.(g),disabled:c,"aria-label":s||x,children:[e.jsx(R,{icon:d}),s&&e.jsx("span",{className:p,children:s}),e.jsx(R,{icon:u})]})};var V=(s=>(s.Info="info",s.Success="success",s.Warning="warning",s.Error="error",s))(V||{});const Se={info:e.jsx(N.IconInfoCircle,{size:24,stroke:2}),error:e.jsx(N.IconAlertCircle,{size:24,stroke:2}),warning:e.jsx(N.IconAlertTriangle,{size:24,stroke:2}),success:e.jsx(N.IconCircleCheck,{size:24,stroke:2})},Re={[V.Info]:"bg-info border-info text-info",[V.Success]:"bg-success border-success text-success",[V.Warning]:"bg-warning border-warning text-warning",[V.Error]:"bg-error border-error text-error"},Fe="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",Ee=({variant:s=V.Info,message:t,cssClass:n,closable:r=!1,onClose:a})=>e.jsxs("div",{role:"alert",className:l(Fe,Re[s],n),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{icon:Se[s]}),e.jsx("div",{className:"text-primary",children:t})]}),r&&e.jsx(M,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:e.jsx(N.IconX,{size:16}),onClick:o=>a?.(o)})]}),Le="flex items-center justify-center text-secondary",Pe="shrink-0 grow-0 basis-auto animate-spin-steps",Te=s=>L.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},L.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),re=({size:s=18,cssClass:t,iconClass:n,fullWidth:r=!0,ariaLabel:a="Loading"})=>e.jsx("div",{role:"status","aria-label":a,className:l({[Le]:!0,"w-full h-full":r,[t||""]:!!t}),children:e.jsx(R,{icon:e.jsx(Te,{width:s,height:s,className:l(Pe,n),role:"img"})})}),Ae=7,Me=2,ae=f.createContext(null),oe=()=>{const s=f.useContext(ae);if(s==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return s},Oe=({initialOpen:s=!1,placement:t="bottom",isTriggerClickable:n=!1,open:r,onOpenChange:a}={})=>{const[o,c]=f.useState(s),u=f.useRef(null),d=r??o,i=a??c,x=h.useFloating({placement:t,open:d,onOpenChange:i,whileElementsMounted:h.autoUpdate,middleware:[h.offset(Ae+Me),h.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),h.shift({padding:5}),h.arrow({element:u})]}),p=h.useHover(x.context,{move:!1,enabled:r==null,mouseOnly:n,delay:{open:500,close:0}}),j=h.useFocus(x.context,{enabled:r==null}),g=h.useDismiss(x.context),v=h.useRole(x.context,{role:"tooltip"}),b=h.useInteractions([p,j,g,v]);return f.useMemo(()=>({open:d,setOpen:i,arrowRef:u,...b,...x}),[d,i,b,x])},Ve=({children:s,...t})=>{const n=Oe(t);return e.jsx(ae.Provider,{value:n,children:s})},Be=f.forwardRef(function({style:t,...n},r){const a=oe(),o=h.useMergeRefs([a.refs.setFloating,r]);return a.open?e.jsx(h.FloatingPortal,{id:"tooltip-portal",children:e.jsxs("div",{ref:o,style:{...a.floatingStyles,...t},...a.getFloatingProps(n),className:l("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(n).className),children:[n.children,e.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}),We=f.forwardRef(function({children:t,asChild:n=!1,...r},a){const o=oe(),u=t&&typeof t=="object"&&"ref"in t&&t.ref!==void 0?t.ref:void 0,d=h.useMergeRefs([o.refs.setReference,a,u]);return n&&f.isValidElement(t)?f.cloneElement(t,o.getReferenceProps({ref:d,...r,...t.props})):e.jsx("span",{ref:d,...o.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-left",children:t})}),O=({hideTooltip:s,tooltip:t,children:n,triggerClassName:r,contentClassName:a,...o})=>e.jsxs(Ve,{...o,children:[e.jsx(We,{className:l(r,"truncate"),children:n}),e.jsx(Be,{className:l("text-primary",a,"max-w-[300px]",(s||!t)&&"hidden"),children:t})]}),_=18,G={size:_,stroke:2},ze=({label:s,id:t,checked:n,indeterminate:r,disabled:a,ariaLabel:o,onChange:c})=>{const u=f.useCallback(p=>{c?.(p.target.checked,t)},[c,t]),d=l("flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",`${n||r?"":'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":""),i=l("mr-2 border rounded",a?"bg-layer-4 border-icon-secondary":""),x=()=>r?e.jsx(N.IconMinus,{className:i,...G}):n?e.jsx(N.IconCheck,{className:i,...G}):null;return e.jsxs("label",{className:d,htmlFor:t,children:[x(),s&&e.jsx(O,{tooltip:s,triggerClassName:"flex-1 min-w-0",children:e.jsx("p",{className:"text-primary w-full truncate",children:s})}),e.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:n,"aria-checked":r?"mixed":n,"aria-disabled":a||void 0,"aria-label":s?void 0:o,className:"invisible w-0 h-0"})]})};var S=(s=>(s.VALID="valid",s.ERROR="error",s))(S||{});const He=(s,t)=>{if(t===s.id)switch(s.status){case S.VALID:return"border-accent-secondary text-primary";case S.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(s.status){case S.VALID:return"border-primary text-white";case S.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},_e=(s,t)=>{if(t===s.id)switch(s.status){case S.VALID:return"bg-accent-secondary";case S.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(s.status){case S.VALID:return"bg-accent-secondary";case S.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Ge=({step:s,index:t,currentStep:n,onChangeStep:r})=>{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",c=()=>n===s.id&&s.status===S.ERROR?e.jsx(N.IconExclamationCircle,{stroke:2,size:16}):n!==s.id&&s.status===S.VALID?e.jsx(N.IconCheck,{stroke:2,size:16}):t+1;return e.jsxs("button",{className:l(a,He(s,n)),onClick:()=>r(s.id),children:[e.jsx("span",{className:l(o,_e(s,n)),children:c()}),e.jsx("span",{children:s.name})]})},$e=({steps:s,currentStep:t,onChangeStep:n})=>{const r=a=>{const o=s.findIndex(u=>u.id===t),c=s.findIndex(u=>u.id===a);(a!==t&&s[o].status===S.VALID||c<o)&&n(a)};return e.jsx("div",{id:"steps",className:"flex gap-x-3",children:s.map((a,o)=>e.jsx(Ge,{currentStep:t,onChangeStep:r,step:a,index:o},a.id))})},le=({name:s,value:t,title:n,description:r,checked:a=!1,inputId:o,cssClass:c,labelCssClass:u,disabled:d,onChange:i,descriptionCssClass:x})=>{const p=`${o}-desc`,j=l("dial-small cursor-pointer",d?"text-secondary":"text-primary",u),g=l("cursor-pointer dial-input-radio",n&&"mr-2",c),v=l("flex flex-col",!!r&&"mb-2"),b=l("dial-tiny mt-2 ml-[26px] text-secondary",x),D=k=>{d||k.target.checked&&i?.(t)};return e.jsxs("div",{className:v,children:[e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx("input",{type:"radio",id:o,name:s,value:t,checked:a,disabled:d,"aria-describedby":a&&r?p:void 0,className:g,onChange:D}),n?e.jsx("label",{className:j,htmlFor:o,children:n}):null]}),a&&r&&e.jsx("div",{id:p,className:b,children:r})]})};var K=(s=>(s.Row="Row",s.Column="Column",s))(K||{});const qe="flex flex-col gap-2",Ke="flex",Ue="pb-1 mt-2",Xe={[K.Column]:"flex-col gap-y-3",[K.Row]:"flex-row gap-x-6"},ie=({fieldTitle:s,radioCssClass:t,labelCssClass:n,disabled:r,elementId:a,radioButtons:o,activeRadioButton:c,orientation:u,onChange:d})=>e.jsxs("div",{className:qe,children:[s&&e.jsx(W,{fieldTitle:s,htmlFor:a}),e.jsx("div",{role:"radiogroup","aria-label":s,"aria-disabled":r||void 0,className:l(Ke,Xe[u]),children:o.map(i=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(le,{name:a,value:i.id,inputId:i.id,disabled:r,cssClass:t,labelCssClass:n,title:i.name,checked:i.id===c,onChange:()=>d(i.id)}),i.id===c&&i.content?e.jsx("div",{className:Ue,children:i.content}):null]},i.id))})]}),Ze=({icon:s,title:t,description:n})=>e.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center text-secondary",children:[s||e.jsx(N.IconClipboardX,{width:60,height:60}),e.jsx("span",{className:"small mt-2 text-primary",children:t}),n&&e.jsx("span",{className:"mt-1 text-primary",children:n})]}),Qe=60,Ye=({containerCssClass:s,children:t,width:n,title:r,iconSize:a=_,titleCssClass:o,additionalButtons:c})=>{const[u,d]=f.useState(n),[i,x]=f.useState(!0),p=l(["transform rotate-180 [writing-mode:tb-rl]",i&&"hidden",o]),j=l(["flex flex-row gap-2 cursor-pointer text-secondary",i?"justify-end":"justify-center"]),g=()=>{d(i?Qe:n),x(!i)};return e.jsxs("div",{className:l(["rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",s]),style:{width:`${u}px`},children:[e.jsx("div",{className:l(["flex-1 min-h-0 overflow-auto",!i&&"hidden"]),children:t}),e.jsx("div",{className:p,children:r}),e.jsxs("div",{className:j,children:[i&&c,e.jsx(M,{cssClass:"hover:text-icon-accent-primary",onClick:g,iconBefore:i?e.jsx(N.IconChevronsLeft,{size:a,stroke:G.stroke}):e.jsx(N.IconChevronsRight,{size:a,stroke:G.stroke})})]})]})},Je=({label:s,text:t,children:n,postfix:r})=>e.jsxs("div",{className:l("flex flex-col",n?"":"max-w-[200px]"),children:[e.jsx("label",{className:"dial-tiny mb-2 text-secondary",children:s}),n||e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx(O,{triggerClassName:"text-primary",tooltip:t,children:t}),r||null]})]});var Y=(s=>(s.Default="default",s))(Y||{});const es={[Y.Default]:"border-icon-secondary bg-layer-3"},ce=({tag:s,cssClass:t,remove:n,variant:r=Y.Default})=>{const a=es[r],o=l("flex items-center gap-1 dial-tiny border rounded p-1 h-[22px] text-primary",t,a);return e.jsxs("div",{className:o,children:[e.jsx("span",{children:s}),n&&e.jsx(M,{iconAfter:e.jsx(N.IconX,{size:16}),onClick:n})]},s)},J=({ariaLabel:s,cssClass:t,size:n=24,onClose:r})=>e.jsx(M,{ariaLabel:s,cssClass:l("text-secondary hover:text-accent-primary",t),onClick:r,iconBefore:e.jsx(N.IconX,{size:n})}),de=({value:s,textareaId:t,placeholder:n,cssClass:r="",disabled:a,invalid:o,readonly:c,onChange:u})=>e.jsx(O,{tooltip:s,triggerClassName:"flex",children:e.jsx("textarea",{id:t,placeholder:n,value:s||"",disabled:a,className:l("dial-textarea dial-input px-3 py-2",o?"dial-input-error":"",a&&"dial-input-disable",c&&"dial-input-readonly",r),onChange:d=>!c&&u?.(d.currentTarget.value)})}),ss=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],ts=(s,t,n,r)=>{if((t==="number"||n!==void 0||r!==void 0)&&!ss.includes(s.key)&&!(s.key==="-"&&s.currentTarget.selectionStart===0&&(n===void 0||n<0))&&!(s.key==="."&&t==="number"&&!s.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(s.key)){s.preventDefault();return}if(n!==void 0||r!==void 0){const o=s.currentTarget.value,c=s.currentTarget.selectionStart||0,u=o.slice(0,c)+s.key+o.slice(c),d=parseFloat(u);if(!isNaN(d)){if(n!==void 0&&d<n){s.preventDefault();return}if(r!==void 0&&d>r){s.preventDefault();return}}}}},U=({iconBefore:s,iconAfter:t,hideBorder:n,value:r,elementId:a,placeholder:o="",cssClass:c="",containerCssClass:u,tooltipTriggerClassName:d,type:i="text",disabled:x,readonly:p,invalid:j,onChange:g,min:v,max:b,prefix:D,suffix:k,textBeforeInput:y,textAfterInput:C})=>{const w=F=>F.target.blur(),A=i==="number"||v!==void 0||b!==void 0,P=F=>{ts(F,i,v,b)},z=F=>{const E=F.currentTarget.value;if(A&&E!==""){const H=parseFloat(E);if(isNaN(H)&&E!=="-"&&E!=="."||!isNaN(H)&&(v!==void 0&&H<v||b!==void 0&&H>b))return}g?.(E)};return e.jsxs("div",{className:l("dial-input-field flex flex-row items-center justify-between py-2",n?"dial-input-no-border":"dial-input",j&&"dial-input-error",x&&"dial-input-disable",p&&"dial-input-readonly",!y&&"pl-3",!C&&"pr-3",u),children:[y&&e.jsx("div",{children:e.jsx(U,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"overflow-hidden overflow-ellipsis dial-small",value:y,disabled:!0,elementId:y+"textBefore"})}),D&&e.jsxs("p",{className:"text-secondary dial-small",children:[" ",D]}),e.jsx(R,{icon:s}),e.jsx(O,{tooltip:r,triggerClassName:l(d,"flex-1"),children:e.jsx("input",{type:i,autoComplete:"off",id:a,placeholder:o,value:r??"",disabled:x,className:l("border-0 bg-transparent",c),onChange:F=>!p&&z?.(F),onKeyDown:P,onWheel:w,min:v,max:b})}),e.jsx(R,{icon:t}),k&&e.jsxs("p",{className:"text-secondary dial-small",children:[" ",k]}),C&&e.jsx("div",{children:e.jsx(U,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",value:C,disabled:!0,elementId:C+"textAfter"})})]})},ns=/^0+\.(\d+)?$/,rs=/^0+/,ue=({fieldTitle:s,errorText:t,optional:n,elementCssClass:r,elementContainerCssClass:a,elementId:o,containerCssClass:c,readonly:u,defaultEmptyText:d,min:i,max:x,...p})=>e.jsxs("div",{className:l("flex flex-col",c),children:[e.jsx(W,{fieldTitle:s,optional:n,htmlFor:o}),u?e.jsx("span",{children:p.value||(d??"None")}):e.jsxs(e.Fragment,{children:[e.jsx(U,{elementId:o,cssClass:r,containerCssClass:a,invalid:t!=null,min:i,max:x,...p}),e.jsx($,{errorText:t})]})]}),as=({onChange:s,value:t,min:n,max:r,...a})=>{const o=c=>String(c)?.match(ns)?String(c)?.replace(rs,"0"):Number(c);return e.jsx(ue,{type:"number",onChange:c=>s?.(o(c)),value:t,min:n,max:r,...a})},os=({onChange:s,...t})=>e.jsx(ue,{type:"text",onChange:n=>s?.(n),...t}),ls=({fieldTitle:s,optional:t,elementId:n,elementCssClass:r,errorText:a,...o})=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(W,{fieldTitle:s,optional:t,htmlFor:n}),e.jsx(de,{textareaId:n,cssClass:r,...o}),e.jsx($,{errorText:a})]}),is=({title:s,switchId:t,isOn:n=!1,disabled:r,onChange:a})=>{const o=l("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",n?"flex-row-reverse":"flex-row",r?"pointer-events-none":"",r?n?"bg-controls-disable":"bg-layer-4":n?"bg-accent-primary":"bg-layer-4"),c=f.useCallback(u=>{u.stopPropagation(),a?.(!n)},[a,n]);return e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx("input",{type:"checkbox",onChange:c,id:t,disabled:r,className:"invisible w-0 h-0",checked:n}),e.jsx("label",{htmlFor:t,className:o,children:e.jsx("span",{className:l("size-3 rounded-full",r?n?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),s&&e.jsx("span",{className:"pl-2 dial-small text-primary",children:s})]})};var B=(s=>(s.Sm="sm",s.Md="md",s.Lg="lg",s))(B||{});const cs="z-[52] flex items-center justify-center bg-blackout md:p-4",ds="divide-tertiary divide-y",us="flex flex-row justify-between py-4 px-6 items-center",xs={[B.Sm]:"dial-sm-popup",[B.Md]:"dial-md-popup",[B.Lg]:"dial-lg-popup"},ee=({open:s=!1,title:t,portalId:n,cssClass:r,overlayClass:a,headingClass:o,dividers:c=!0,children:u,footer:d,onClose:i,size:x=B.Md})=>{const{refs:p,context:j}=h.useFloating({open:s,onOpenChange:y=>{y||i?.(null)}}),g=h.useRole(j,{role:"dialog"}),v=h.useDismiss(j,{outsidePress:!0}),{getFloatingProps:b}=h.useInteractions([g,v]);if(!s)return null;const D=typeof t=="string"?"dial-popup-heading":void 0,k=y=>y?typeof y=="string"?e.jsx("h3",{id:D,className:l("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",o),children:e.jsx(O,{tooltip:y,children:y})}):y:e.jsx("span",{});return e.jsx(h.FloatingPortal,{id:n,children:e.jsx(h.FloatingOverlay,{className:l(cs,a),children:e.jsx(h.FloatingFocusManager,{context:j,children:e.jsxs("div",{ref:p.setFloating,...b(),role:"dialog","aria-modal":"true","aria-labelledby":D,className:l("dial-popup",xs[x],c&&ds,r),children:[e.jsxs("div",{className:us,children:[k(t),e.jsx(J,{ariaLabel:"Close dialog",onClose:y=>i?.(y)})]}),e.jsx("div",{className:"flex-grow overflow-auto",children:u}),d]})})})})};var X=(s=>(s.Info="info",s.Danger="danger",s))(X||{});const ps="flex justify-end gap-2 px-6 py-4",fs="text-secondary dial-small-150 px-6 py-4",ms="Cancel",te={[X.Info]:{confirmVariant:I.Primary,cancelVariant:I.Secondary},[X.Danger]:{container:"border-t-4 border-error",confirmVariant:I.Danger,cancelVariant:I.Secondary}},hs=({title:s,description:t,descriptionCssClass:n,open:r=!1,confirmLabel:a,cancelLabel:o=ms,isLoading:c=!1,disableConfirmButton:u=!1,cssClass:d,confirmClassName:i,onClose:x,onConfirm:p,onCancel:j,children:g,dividers:v=!1,variant:b=X.Info,size:D=B.Sm})=>{const k=c?null:e.jsxs("div",{className:ps,children:[e.jsx(M,{variant:I.Secondary,title:o,onClick:()=>j?j():x?.()}),e.jsx(M,{variant:te[b].confirmVariant,cssClass:i,title:a,disable:u,onClick:()=>p()})]}),y=f.useCallback(()=>c?e.jsx("div",{className:"px-6 py-4 h-[120px]",children:e.jsx(re,{size:50})}):g??(t?e.jsx("div",{className:l(fs,n),children:t}):null),[g,t,c,n]);return e.jsx(ee,{open:r,title:s,cssClass:l(te[b].container,d),dividers:v,onClose:()=>x?.(),footer:k,size:D,children:y()})},se=({selectedItems:s,listCssClass:t,listElementCssClass:n})=>!!s?.length&&e.jsx("ul",{className:l("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:s?.map(r=>e.jsx("li",{className:l(["tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",n]),children:e.jsx(O,{tooltip:r,children:e.jsx("button",{"aria-label":"autocomplete-action",type:"button",className:"truncate w-full",children:r})})},r))}),ne=s=>L.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},L.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),xe=({children:s,open:t,readonly:n,selectedValue:r,valueCssClasses:a,inputCssClasses:o,onOpen:c,elementId:u,errorText:d,emptyValueText:i})=>{const x=Array.isArray(r)&&r.length>0,p=typeof r=="string"&&!!r.trim(),j=x||p?r:i,g=n?void 0:c,v=()=>e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"w-full",onClick:g,"aria-label":"open-popup",id:u,children:e.jsxs("div",{className:l("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",o,n&&"dial-input-disable",d&&"dial-input-error"),children:[e.jsx(O,{tooltip:String(j),children:e.jsx("span",{className:a,children:j})}),!n&&e.jsx("div",{className:"flex-shrink-0",children:e.jsx(R,{icon:e.jsx(ne,{role:"img",width:_,height:_})})})]})}),d&&e.jsx($,{errorText:d})]}),b=()=>e.jsx("div",{className:"w-full",onClick:g,children:e.jsxs("div",{className:l("dial-input px-3 py-2 flex flex-row items-center w-full justify-between",n&&"dial-input-disable"),children:[e.jsx(se,{selectedItems:j}),!n&&e.jsx("div",{className:"ml-1",children:e.jsx(R,{icon:e.jsx(ne,{role:"img",width:_,height:_})})})]})});return e.jsxs(e.Fragment,{children:[x?b():v(),t&&ke.createPortal(s,document.body)]})},gs=({fieldTitle:s,htmlFor:t,readonly:n,selectedValue:r,radioButtons:a,customInputValue:o,valueCssClasses:c,inputCssClasses:u,emptyValueText:d,onClose:i,title:x,portalId:p,onApply:j,cancelButtonTitle:g="Cancel",applyButtonTitle:v="Apply",isValid:b,selectedRadioValue:D,onChangeRadioField:k,id:y})=>{const[C,w]=f.useState(!1),A=f.useCallback(()=>{n||w(!0)},[n]),P=f.useCallback(()=>{w(!1),i?.()},[i]),z=f.useCallback(()=>{j(),P()},[j,P]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx(W,{fieldTitle:s,htmlFor:t}),e.jsx(xe,{readonly:n,open:C,selectedValue:o??a.find(F=>F.id===r)?.name,valueCssClasses:c,inputCssClasses:l(u,"py-2","px-3"),emptyValueText:d,onOpen:A,children:e.jsx(ee,{open:C,onClose:P,title:x,portalId:p,footer:e.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[e.jsx(M,{variant:I.Secondary,title:g,onClick:P}),e.jsx(M,{variant:I.Primary,title:v,onClick:z,disable:!b})]}),children:e.jsx("div",{className:"px-6 py-4",children:e.jsx(ie,{radioButtons:a,labelCssClass:"dial-small",activeRadioButton:D,onChange:k,elementId:y,orientation:K.Column})})})})]})},js=({onClick:s})=>e.jsx(N.IconEyeOff,{...G,className:"text-primary",onClick:s}),Cs=({onClick:s})=>e.jsx(N.IconEye,{...G,className:"text-primary",onClick:s}),pe=({...s})=>{const[t,n]=f.useState(!1),r=f.useCallback(a=>{n(a)},[]);return e.jsx(U,{type:t?"text":"password",...s,iconAfter:t?e.jsx(js,{onClick:()=>r(!1)}):e.jsx(Cs,{onClick:()=>r(!0)})})},bs=({fieldTitle:s,optional:t,elementCssClass:n,elementId:r,errorText:a,...o})=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(W,{fieldTitle:s,optional:t,htmlFor:r}),e.jsx(pe,{cssClass:n,elementId:r,invalid:!!a,...o}),e.jsx($,{errorText:a})]});var Z=(s=>(s.Small="small",s.Base="base",s))(Z||{});const ys={[Z.Small]:{textClass:"text-xs px-1",containerClass:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[Z.Base]:{textClass:"text-sm px-2",containerClass:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},vs=({elementId:s,value:t,placeholder:n,disabled:r,readonly:a,invalid:o,cssClass:c,containerCssClass:u,onChange:d,size:i=Z.Base})=>{const[x,p]=f.useState(t||"");f.useEffect(()=>{p(t||"")},[t]);const j=f.useCallback(b=>{p(b),d?.(b)},[d]),g=ys[i],v=f.useCallback(()=>{j("")},[j]);return e.jsxs("div",{className:l("dial-input flex flex-row items-center justify-between",o&&"dial-input-error",r&&"dial-input-disable",a&&"dial-input-readonly",g.containerClass,u),children:[e.jsx(R,{className:l(r?"text-secondary":"text-primary"),icon:e.jsx(N.IconSearch,{size:g.iconSize,stroke:g.iconStroke})}),e.jsx("input",{id:s,type:"text",autoComplete:"off",placeholder:n,value:x??"",disabled:r,readOnly:a,className:l("border-0 bg-transparent w-full",c,g.textClass),onChange:b=>!a&&j(b.currentTarget.value)}),x&&!a&&!r&&e.jsx(R,{className:"text-primary cursor-pointer",icon:e.jsx(N.IconX,{size:g.iconSize,stroke:g.iconStroke,onClick:v,"aria-label":"Clear search",role:"button"})})]})},ws=({placeholder:s="",selectedItems:t=[],updateSelected:n,listCssClass:r,listElementCssClass:a,containerCssClass:o,inputCssClass:c})=>{const[u,d]=f.useState(""),i=f.useCallback(p=>{p.key==="Enter"&&(n([...t,p.currentTarget.value]),d("")),(p.key==="Backspace"||p.key==="Delete")&&t.length&&!u&&n(t.slice(0,-1))},[t,n,u]),x=f.useCallback(p=>{d(p.target.value)},[d]);return e.jsxs("div",{className:l(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",o]),children:[e.jsx(se,{selectedItems:t,listCssClass:r,listElementCssClass:a}),e.jsx("input",{type:"text",value:u,className:l(["border-0 bg-transparent p-0",c]),placeholder:t?.length?"":s,onKeyDown:i,onChange:x})]})},Ns=({initialTags:s=[],fieldTitle:t,optional:n,elementId:r,placeholder:a,errorText:o,invalid:c,disabled:u,onChange:d})=>{const i=f.useRef(null),[x,p]=f.useState(s),[j,g]=f.useState(""),[v,b]=f.useState(!1),D=C=>{const w=C.trim().replace(/,$/,"");if(w&&!x.includes(w)){const A=[w,...x];p(A),d?.(A)}},k=C=>{(C.key===","||C.key==="Enter")&&(C.preventDefault(),D(j),g(""))},y=C=>{const w=x.filter((A,P)=>P!==C);p(w),d?.(w)};return f.useEffect(()=>{const C=new ResizeObserver(()=>{if(i.current){const w=i.current.scrollHeight>i.current.clientHeight+10;b(w)}});return i.current&&C.observe(i.current),()=>C.disconnect()},[x]),e.jsxs("div",{className:l("flex flex-col w-full"),children:[e.jsx(W,{fieldTitle:t,optional:n,htmlFor:r}),e.jsx("div",{className:l("dial-input min-h-[38px] p-[6px]",c&&"dial-input-error",u&&"dial-input-disable"),children:e.jsxs("div",{ref:i,className:l("flex flex-wrap gap-2 items-center",v?"flex-col-reverse":"flex-row"),children:[x.map((C,w)=>e.jsx(ce,{tag:C,remove:u?void 0:()=>y(w)},C+w)),e.jsx("input",{type:"text",value:j,onChange:C=>g(C.target.value),onKeyDown:k,className:l("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:a,disabled:u})]})}),e.jsx($,{errorText:o})]})};var fe=(s=>(s.Dropdown="dropdown",s.Menu="menu",s))(fe||{}),q=(s=>(s.Click="click",s.Hover="hover",s.ContextMenu="contextMenu",s))(q||{}),me=(s=>(s.Item="item",s.Divider="divider",s))(me||{});const ks=l("inline-flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Ds=l("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none","w-max"),Is=l("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),Ss="opacity-75 !cursor-not-allowed",Rs="text-error",Fs="my-1 border-t border-hover",Q=8,Es=({children:s,menu:t,renderOverlay:n,trigger:r=[q.Click],placement:a,disabled:o=!1,open:c,defaultOpen:u=!1,onOpenChange:d,closable:i=!1,onClose:x,cssClass:p,listClassName:j,outsidePressIgnoreRef:g,outsideClosable:v=!0})=>{const[b,D]=f.useState(u),k=c!==void 0,y=k?!!c:b,C=f.useCallback(m=>{k||D(m),d?.(m)},[k,d]),w=f.useId(),A=m=>m?"clientWidth"in m?m.clientWidth:m.getBoundingClientRect?.()?.width??0:0,P=a===void 0,{refs:z,floatingStyles:F,context:E}=h.useFloating({placement:a,open:y,onOpenChange:C,whileElementsMounted:h.autoUpdate,middleware:[h.offset({mainAxis:Q,crossAxis:0}),P?h.autoPlacement({alignment:"start",crossAxis:!0,padding:Q}):h.flip({padding:Q}),h.shift({padding:Q}),h.size({apply({availableWidth:m,elements:T}){const Ne=A(T.reference);T.floating.style.setProperty("--reference-width",`${Ne}px`),T.floating.style.maxWidth=`${m}px`}})]}),H=h.useClick(E,{enabled:r.includes(q.Click)&&!o}),he=h.useHover(E,{enabled:r.includes(q.Hover)&&!o,move:!1,restMs:40,delay:{open:80,close:80}}),ge=h.useDismiss(E,{bubbles:!0,referencePress:!1,outsidePress:m=>{if(!v)return!1;const T=m.target;return!(g?.current&&T instanceof Node&&g.current.contains(T))}}),je=h.useRole(E,{role:"menu"}),{getReferenceProps:Ce,getFloatingProps:be}=h.useInteractions([H,he,ge,je]),ye=m=>{!r.includes(q.ContextMenu)||o||(m.preventDefault(),C(!0))};f.useEffect(()=>{o&&y&&C(!1)},[o,y,C]);const ve=m=>T=>{m.disabled||(m.onClick?.({key:m.key,domEvent:T}),t?.onClick?.({key:m.key,domEvent:T}),C(!1))},we=n?n():t&&e.jsx("div",{role:"none",className:"py-1",children:t.items.map(m=>m.type===me.Divider?e.jsx("div",{role:"separator",className:Fs},m.key):e.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!m.disabled,className:l(Is,m.disabled&&Ss,m.danger&&Rs),disabled:m.disabled,onClick:ve(m),children:[m.icon&&e.jsx("span",{className:l(m.danger&&"text-error",m.disabled&&"text-secondary"),children:e.jsx(R,{icon:m.icon})}),e.jsx("span",{className:l("flex-1 truncate text-left",m.danger&&"text-error",m.disabled&&"text-secondary"),children:m.label})]},m.key))});return e.jsxs(e.Fragment,{children:[e.jsx("span",{ref:z.setReference,className:l(ks,o&&"!cursor-not-allowed opacity-75",p),"aria-haspopup":"menu","aria-expanded":y,"aria-controls":w,onContextMenu:ye,...Ce(),children:s}),y&&e.jsx(h.FloatingPortal,{children:e.jsx(h.FloatingFocusManager,{context:E,modal:!1,initialFocus:-1,returnFocus:!0,children:e.jsxs("div",{id:w,ref:z.setFloating,style:F,className:l(Ds,j),...be(),children:[i&&e.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:e.jsx(J,{ariaLabel:"Close dropdown",onClose:m=>{x?.(m),C(!1)}})}),we]})})})]})};exports.AlertVariant=V;exports.ButtonVariant=I;exports.ConfirmationPopupVariant=X;exports.DialAlert=Ee;exports.DialAutocompleteInput=ws;exports.DialAutocompleteInputValue=se;exports.DialButton=M;exports.DialCheckbox=ze;exports.DialCloseButton=J;exports.DialCollapsibleSidebar=Ye;exports.DialConfirmationPopup=hs;exports.DialDropdown=Es;exports.DialErrorText=$;exports.DialFieldLabel=W;exports.DialIcon=R;exports.DialInput=U;exports.DialInputPopup=xe;exports.DialLabelledText=Je;exports.DialLoader=re;exports.DialNoDataContent=Ze;exports.DialNumberInputField=as;exports.DialPasswordInput=pe;exports.DialPasswordInputField=bs;exports.DialPopup=ee;exports.DialRadioButton=le;exports.DialRadioGroup=ie;exports.DialRadioGroupPopupField=gs;exports.DialSearch=vs;exports.DialSteps=$e;exports.DialSwitch=is;exports.DialTag=ce;exports.DialTagInput=Ns;exports.DialTextAreaField=ls;exports.DialTextInputField=os;exports.DialTextarea=de;exports.DialTooltip=O;exports.DropdownType=fe;exports.PopupSize=B;exports.RadioGroupOrientation=K;exports.SearchSize=Z;exports.StepStatus=S;exports.TagVariant=Y;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("classnames"),N=require("@tabler/icons-react"),f=require("react"),h=require("@floating-ui/react"),ke=require("react-dom");function De(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return t.default=s,Object.freeze(t)}const L=De(f),$=({errorText:s})=>s&&e.jsx("span",{className:"text-error dial-tiny mt-1",children:s}),z=({fieldTitle:s,htmlFor:t,optional:n,optionalText:r,cssClass:a})=>s?e.jsxs("label",{className:l("dial-tiny text-secondary",a,!a?.includes("mb")&&"mb-2"),htmlFor:t,children:[e.jsx("span",{className:"min-h-4",children:s}),n&&e.jsx("span",{className:"ml-1",children:r??"(Optional)"})]}):null,F=({icon:s,className:t})=>s?e.jsx("span",{className:l("flex-shrink-0",t),children:s}):null;var S=(s=>(s.Primary="primary",s.Secondary="secondary",s.Tertiary="tertiary",s.Danger="danger",s))(S||{});const Ie={[S.Primary]:"dial-primary-button",[S.Secondary]:"dial-secondary-button",[S.Tertiary]:"dial-tertiary-button",[S.Danger]:"dial-danger-button"},M=({title:s,variant:t,cssClass:n,textCssClass:r,ref:a,onClick:o,disable:c,iconAfter:u,iconBefore:d,hideTitleOnMobile:i,ariaLabel:x})=>{const p=l("dial-small-semi",u?"mr-2":"",d?"ml-2":"",i?"hidden sm:inline":"inline",r),j=l(t&&Ie[t],n,"focus-visible:outline outline-offset-0");return e.jsxs("button",{ref:a,type:"button",className:j,onClick:g=>o?.(g),disabled:c,"aria-label":s||x,children:[e.jsx(F,{icon:d}),s&&e.jsx("span",{className:p,children:s}),e.jsx(F,{icon:u})]})};var W=(s=>(s.Info="info",s.Success="success",s.Warning="warning",s.Error="error",s))(W||{});const Se={info:e.jsx(N.IconInfoCircle,{size:24,stroke:2}),error:e.jsx(N.IconAlertCircle,{size:24,stroke:2}),warning:e.jsx(N.IconAlertTriangle,{size:24,stroke:2}),success:e.jsx(N.IconCircleCheck,{size:24,stroke:2})},Re={[W.Info]:"bg-info border-info text-info",[W.Success]:"bg-success border-success text-success",[W.Warning]:"bg-warning border-warning text-warning",[W.Error]:"bg-error border-error text-error"},Fe="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",Ee=({variant:s=W.Info,message:t,cssClass:n,closable:r=!1,onClose:a})=>e.jsxs("div",{role:"alert",className:l(Fe,Re[s],n),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{icon:Se[s]}),e.jsx("div",{className:"text-primary",children:t})]}),r&&e.jsx(M,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:e.jsx(N.IconX,{size:16}),onClick:o=>a?.(o)})]}),Le="flex items-center justify-center text-secondary",Pe="shrink-0 grow-0 basis-auto animate-spin-steps",Te=s=>L.createElement("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},L.createElement("path",{d:"M24 39V46.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.4,d:"M9 24H1.5",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.5,d:"M8.0918 8.0918L13.3994 13.3994",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.6,d:"M24 1.5V9",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.7,d:"M39.9121 8.08594L37.2607 10.7373L34.6094 13.3887",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.8,d:"M46.5 24H39",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.9,d:"M34.6055 34.6055L39.9082 39.9082",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{opacity:.3,d:"M13.3936 34.6055L8.08594 39.9131",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),re=({size:s=18,cssClass:t,iconClass:n,fullWidth:r=!0,ariaLabel:a="Loading"})=>e.jsx("div",{role:"status","aria-label":a,className:l({[Le]:!0,"w-full h-full":r,[t||""]:!!t}),children:e.jsx(F,{icon:e.jsx(Te,{width:s,height:s,className:l(Pe,n),role:"img"})})}),Ae=7,Me=2,ae=f.createContext(null),oe=()=>{const s=f.useContext(ae);if(s==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return s},Oe=({initialOpen:s=!1,placement:t="bottom",isTriggerClickable:n=!1,open:r,onOpenChange:a}={})=>{const[o,c]=f.useState(s),u=f.useRef(null),d=r??o,i=a??c,x=h.useFloating({placement:t,open:d,onOpenChange:i,whileElementsMounted:h.autoUpdate,middleware:[h.offset(Ae+Me),h.flip({crossAxis:t.includes("-"),fallbackAxisSideDirection:"start",padding:5}),h.shift({padding:5}),h.arrow({element:u})]}),p=h.useHover(x.context,{move:!1,enabled:r==null,mouseOnly:n,delay:{open:500,close:0}}),j=h.useFocus(x.context,{enabled:r==null}),g=h.useDismiss(x.context),v=h.useRole(x.context,{role:"tooltip"}),y=h.useInteractions([p,j,g,v]);return f.useMemo(()=>({open:d,setOpen:i,arrowRef:u,...y,...x}),[d,i,y,x])},Ve=({children:s,...t})=>{const n=Oe(t);return e.jsx(ae.Provider,{value:n,children:s})},Be=f.forwardRef(function({style:t,...n},r){const a=oe(),o=h.useMergeRefs([a.refs.setFloating,r]);return a.open?e.jsx(h.FloatingPortal,{id:"tooltip-portal",children:e.jsxs("div",{ref:o,style:{...a.floatingStyles,...t},...a.getFloatingProps(n),className:l("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(n).className),children:[n.children,e.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}),We=f.forwardRef(function({children:t,asChild:n=!1,...r},a){const o=oe(),u=t&&typeof t=="object"&&"ref"in t&&t.ref!==void 0?t.ref:void 0,d=h.useMergeRefs([o.refs.setReference,a,u]);return n&&f.isValidElement(t)?f.cloneElement(t,o.getReferenceProps({ref:d,...r,...t.props})):e.jsx("span",{ref:d,...o.getReferenceProps(r),className:r.className??"dial-tooltip-trigger text-left",children:t})}),V=({hideTooltip:s,tooltip:t,children:n,triggerClassName:r,contentClassName:a,...o})=>e.jsxs(Ve,{...o,children:[e.jsx(We,{className:l(r,"truncate"),children:n}),e.jsx(Be,{className:l("text-primary",a,"max-w-[300px]",(s||!t)&&"hidden"),children:t})]}),_=18,G={size:_,stroke:2},ze=({label:s,id:t,checked:n,indeterminate:r,disabled:a,ariaLabel:o,onChange:c})=>{const u=f.useCallback(p=>{c?.(p.target.checked,t)},[c,t]),d=l("flex flex-row items-center cursor-pointer text-accent-primary small-medium flex-1 min-w-0",`${n||r?"":'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":""),i=l("mr-2 border rounded",a?"bg-layer-4 border-icon-secondary":""),x=()=>r?e.jsx(N.IconMinus,{className:i,...G}):n?e.jsx(N.IconCheck,{className:i,...G}):null;return e.jsxs("label",{className:d,htmlFor:t,children:[x(),s&&e.jsx(V,{tooltip:s,triggerClassName:"flex-1 min-w-0",children:e.jsx("p",{className:"text-primary w-full truncate",children:s})}),e.jsx("input",{type:"checkbox",role:"checkbox",name:t,onChange:u,id:t,checked:n,"aria-checked":r?"mixed":n,"aria-disabled":a||void 0,"aria-label":s?void 0:o,className:"invisible w-0 h-0"})]})};var R=(s=>(s.VALID="valid",s.ERROR="error",s))(R||{});const He=(s,t)=>{if(t===s.id)switch(s.status){case R.VALID:return"border-accent-secondary text-primary";case R.ERROR:return"border-red-900 text-primary";default:return"border-accent-primary text-primary"}switch(s.status){case R.VALID:return"border-primary text-white";case R.ERROR:return"border-red-900 text-error";default:return"border-primary text-secondary"}},_e=(s,t)=>{if(t===s.id)switch(s.status){case R.VALID:return"bg-accent-secondary";case R.ERROR:return"bg-red-400";default:return"bg-accent-primary"}switch(s.status){case R.VALID:return"bg-accent-secondary";case R.ERROR:return"bg-red-400";default:return"bg-layer-4"}},Ge=({step:s,index:t,currentStep:n,onChangeStep:r})=>{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",c=()=>n===s.id&&s.status===R.ERROR?e.jsx(N.IconExclamationCircle,{stroke:2,size:16}):n!==s.id&&s.status===R.VALID?e.jsx(N.IconCheck,{stroke:2,size:16}):t+1;return e.jsxs("button",{className:l(a,He(s,n)),onClick:()=>r(s.id),children:[e.jsx("span",{className:l(o,_e(s,n)),children:c()}),e.jsx("span",{children:s.name})]})},$e=({steps:s,currentStep:t,onChangeStep:n})=>{const r=a=>{const o=s.findIndex(u=>u.id===t),c=s.findIndex(u=>u.id===a);(a!==t&&s[o].status===R.VALID||c<o)&&n(a)};return e.jsx("div",{id:"steps",className:"flex gap-x-3",children:s.map((a,o)=>e.jsx(Ge,{currentStep:t,onChangeStep:r,step:a,index:o},a.id))})},le=({name:s,value:t,title:n,description:r,checked:a=!1,inputId:o,cssClass:c,labelCssClass:u,disabled:d,onChange:i,descriptionCssClass:x})=>{const p=`${o}-desc`,j=l("dial-small cursor-pointer",d?"text-secondary":"text-primary",u),g=l("cursor-pointer dial-input-radio",n&&"mr-2",c),v=l("flex flex-col",!!r&&"mb-2"),y=l("dial-tiny mt-2 ml-[26px] text-secondary",x),D=k=>{d||k.target.checked&&i?.(t)};return e.jsxs("div",{className:v,children:[e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx("input",{type:"radio",id:o,name:s,value:t,checked:a,disabled:d,"aria-describedby":a&&r?p:void 0,className:g,onChange:D}),n?e.jsx("label",{className:j,htmlFor:o,children:n}):null]}),a&&r&&e.jsx("div",{id:p,className:y,children:r})]})};var K=(s=>(s.Row="Row",s.Column="Column",s))(K||{});const qe="flex flex-col gap-2",Ke="flex",Ue="pb-1 mt-2",Xe={[K.Column]:"flex-col gap-y-3",[K.Row]:"flex-row gap-x-6"},ie=({fieldTitle:s,radioCssClass:t,labelCssClass:n,disabled:r,elementId:a,radioButtons:o,activeRadioButton:c,orientation:u,onChange:d})=>e.jsxs("div",{className:qe,children:[s&&e.jsx(z,{fieldTitle:s,htmlFor:a}),e.jsx("div",{role:"radiogroup","aria-label":s,"aria-disabled":r||void 0,className:l(Ke,Xe[u]),children:o.map(i=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(le,{name:a,value:i.id,inputId:i.id,disabled:r,cssClass:t,labelCssClass:n,title:i.name,checked:i.id===c,onChange:()=>d(i.id)}),i.id===c&&i.content?e.jsx("div",{className:Ue,children:i.content}):null]},i.id))})]}),Ze=({icon:s,title:t,description:n})=>e.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center text-secondary",children:[s||e.jsx(N.IconClipboardX,{width:60,height:60}),e.jsx("span",{className:"small mt-2 text-primary",children:t}),n&&e.jsx("span",{className:"mt-1 text-primary",children:n})]}),Qe=60,Ye=({containerCssClass:s,children:t,width:n,title:r,iconSize:a=_,titleCssClass:o,additionalButtons:c})=>{const[u,d]=f.useState(n),[i,x]=f.useState(!0),p=l(["transform rotate-180 [writing-mode:tb-rl]",i&&"hidden",o]),j=l(["flex flex-row gap-2 cursor-pointer text-secondary",i?"justify-end":"justify-center"]),g=()=>{d(i?Qe:n),x(!i)};return e.jsxs("div",{className:l(["rounded p-4 flex flex-col justify-between overflow-y-auto flex-shrink-0",s]),style:{width:`${u}px`},children:[e.jsx("div",{className:l(["flex-1 min-h-0 overflow-auto",!i&&"hidden"]),children:t}),e.jsx("div",{className:p,children:r}),e.jsxs("div",{className:j,children:[i&&c,e.jsx(M,{cssClass:"hover:text-icon-accent-primary",onClick:g,iconBefore:i?e.jsx(N.IconChevronsLeft,{size:a,stroke:G.stroke}):e.jsx(N.IconChevronsRight,{size:a,stroke:G.stroke})})]})]})},Je=({label:s,text:t,children:n,postfix:r})=>e.jsxs("div",{className:l("flex flex-col",n?"":"max-w-[200px]"),children:[e.jsx("label",{className:"dial-tiny mb-2 text-secondary",children:s}),n||e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx(V,{triggerClassName:"text-primary",tooltip:t,children:t}),r||null]})]});var Y=(s=>(s.Default="default",s))(Y||{});const es={[Y.Default]:"border-icon-secondary bg-layer-3"},ce=({tag:s,cssClass:t,remove:n,variant:r=Y.Default})=>{const a=es[r],o=l("flex items-center gap-1 dial-tiny border rounded p-1 h-[22px] text-primary",t,a);return e.jsxs("div",{className:o,children:[e.jsx("span",{children:s}),n&&e.jsx(M,{iconAfter:e.jsx(N.IconX,{size:16}),onClick:n})]},s)},J=({ariaLabel:s,cssClass:t,size:n=24,onClose:r})=>e.jsx(M,{ariaLabel:s,cssClass:l("text-secondary hover:text-accent-primary",t),onClick:r,iconBefore:e.jsx(N.IconX,{size:n})}),de=({value:s,textareaId:t,placeholder:n,cssClass:r="",disabled:a,invalid:o,readonly:c,onChange:u})=>e.jsx(V,{tooltip:s,triggerClassName:"flex",children:e.jsx("textarea",{id:t,placeholder:n,value:s||"",disabled:a,className:l("dial-textarea dial-input px-3 py-2",o?"dial-input-error":"",a&&"dial-input-disable",c&&"dial-input-readonly",r),onChange:d=>!c&&u?.(d.currentTarget.value)})}),ss=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],ts=(s,t,n,r)=>{if((t==="number"||n!==void 0||r!==void 0)&&!ss.includes(s.key)&&!(s.key==="-"&&s.currentTarget.selectionStart===0&&(n===void 0||n<0))&&!(s.key==="."&&t==="number"&&!s.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(s.key)){s.preventDefault();return}if(n!==void 0||r!==void 0){const o=s.currentTarget.value,c=s.currentTarget.selectionStart||0,u=o.slice(0,c)+s.key+o.slice(c),d=parseFloat(u);if(!isNaN(d)){if(n!==void 0&&d<n){s.preventDefault();return}if(r!==void 0&&d>r){s.preventDefault();return}}}}},U=({iconBefore:s,iconAfter:t,hideBorder:n,value:r,elementId:a,placeholder:o="",cssClass:c="",containerCssClass:u,tooltipTriggerClassName:d,type:i="text",disabled:x,readonly:p,invalid:j,onChange:g,min:v,max:y,prefix:D,suffix:k,textBeforeInput:b,textAfterInput:C})=>{const w=E=>E.target.blur(),P=i==="number"||v!==void 0||y!==void 0,B=E=>{ts(E,i,v,y)},A=E=>{const I=E.currentTarget.value;if(P&&I!==""){const H=parseFloat(I);if(isNaN(H)&&I!=="-"&&I!=="."||!isNaN(H)&&(v!==void 0&&H<v||y!==void 0&&H>y))return}g?.(I)};return e.jsxs("div",{className:l("dial-input-field flex flex-row items-center justify-between py-2",n?"dial-input-no-border":"dial-input",j&&"dial-input-error",x&&"dial-input-disable",p&&"dial-input-readonly",!b&&"pl-3",!C&&"pr-3",u),children:[b&&e.jsx("div",{children:e.jsx(U,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"overflow-hidden overflow-ellipsis dial-small",value:b,disabled:!0,elementId:b+"textBefore"})}),D&&e.jsxs("p",{className:"text-secondary dial-small",children:[" ",D]}),e.jsx(F,{icon:s}),e.jsx(V,{tooltip:r,triggerClassName:l(d,"flex-1"),children:e.jsx("input",{type:i,autoComplete:"off",id:a,placeholder:o,value:r??"",disabled:x,className:l("border-0 bg-transparent",c),onChange:E=>!p&&A?.(E),onKeyDown:B,onWheel:w,min:v,max:y})}),e.jsx(F,{icon:t}),k&&e.jsxs("p",{className:"text-secondary dial-small",children:[" ",k]}),C&&e.jsx("div",{children:e.jsx(U,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",value:C,disabled:!0,elementId:C+"textAfter"})})]})},ns=/^0+\.(\d+)?$/,rs=/^0+/,ue=({fieldTitle:s,errorText:t,optional:n,elementCssClass:r,elementContainerCssClass:a,elementId:o,containerCssClass:c,readonly:u,defaultEmptyText:d,min:i,max:x,...p})=>e.jsxs("div",{className:l("flex flex-col",c),children:[e.jsx(z,{fieldTitle:s,optional:n,htmlFor:o}),u?e.jsx("span",{children:p.value||(d??"None")}):e.jsxs(e.Fragment,{children:[e.jsx(U,{elementId:o,cssClass:r,containerCssClass:a,invalid:t!=null,min:i,max:x,...p}),e.jsx($,{errorText:t})]})]}),as=({onChange:s,value:t,min:n,max:r,...a})=>{const o=c=>String(c)?.match(ns)?String(c)?.replace(rs,"0"):Number(c);return e.jsx(ue,{type:"number",onChange:c=>s?.(o(c)),value:t,min:n,max:r,...a})},os=({onChange:s,...t})=>e.jsx(ue,{type:"text",onChange:n=>s?.(n),...t}),ls=({fieldTitle:s,optional:t,elementId:n,elementCssClass:r,errorText:a,...o})=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(z,{fieldTitle:s,optional:t,htmlFor:n}),e.jsx(de,{textareaId:n,cssClass:r,...o}),e.jsx($,{errorText:a})]}),is=({title:s,switchId:t,isOn:n=!1,disabled:r,onChange:a})=>{const o=l("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",n?"flex-row-reverse":"flex-row",r?"pointer-events-none":"",r?n?"bg-controls-disable":"bg-layer-4":n?"bg-accent-primary":"bg-layer-4"),c=f.useCallback(u=>{u.stopPropagation(),a?.(!n)},[a,n]);return e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx("input",{type:"checkbox",onChange:c,id:t,disabled:r,className:"invisible w-0 h-0",checked:n}),e.jsx("label",{htmlFor:t,className:o,children:e.jsx("span",{className:l("size-3 rounded-full",r?n?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),s&&e.jsx("span",{className:"pl-2 dial-small text-primary",children:s})]})};var O=(s=>(s.Sm="sm",s.Md="md",s.Lg="lg",s))(O||{});const cs="z-[52] flex items-center justify-center bg-blackout md:p-4",ds="divide-tertiary divide-y",us="flex flex-row justify-between py-4 px-6 items-center",xs={[O.Sm]:"dial-sm-popup",[O.Md]:"dial-md-popup",[O.Lg]:"dial-lg-popup"},ee=({open:s=!1,title:t,portalId:n,cssClass:r,overlayClass:a,headingClass:o,dividers:c=!0,children:u,footer:d,onClose:i,size:x=O.Md})=>{const{refs:p,context:j}=h.useFloating({open:s,onOpenChange:b=>{b||i?.(null)}}),g=h.useRole(j,{role:"dialog"}),v=h.useDismiss(j,{outsidePress:!0}),{getFloatingProps:y}=h.useInteractions([g,v]);if(!s)return null;const D=typeof t=="string"?"dial-popup-heading":void 0,k=b=>b?typeof b=="string"?e.jsx("h3",{id:D,className:l("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",o),children:e.jsx(V,{tooltip:b,children:b})}):b:e.jsx("span",{});return e.jsx(h.FloatingPortal,{id:n,children:e.jsx(h.FloatingOverlay,{className:l(cs,a),children:e.jsx(h.FloatingFocusManager,{context:j,children:e.jsxs("div",{ref:p.setFloating,...y(),role:"dialog","aria-modal":"true","aria-labelledby":D,className:l("dial-popup",xs[x],c&&ds,r),children:[e.jsxs("div",{className:us,children:[k(t),e.jsx(J,{ariaLabel:"Close dialog",onClose:b=>i?.(b)})]}),e.jsx("div",{className:"flex-grow overflow-auto",children:u}),d]})})})})};var X=(s=>(s.Info="info",s.Danger="danger",s))(X||{});const ps="flex justify-end gap-2 px-6 py-4",fs="text-secondary dial-small-150 px-6 py-4",ms="Cancel",te={[X.Info]:{confirmVariant:S.Primary,cancelVariant:S.Secondary},[X.Danger]:{container:"border-t-4 border-error",confirmVariant:S.Danger,cancelVariant:S.Secondary}},hs=({title:s,description:t,descriptionCssClass:n,open:r=!1,confirmLabel:a,cancelLabel:o=ms,isLoading:c=!1,disableConfirmButton:u=!1,cssClass:d,confirmClassName:i,onClose:x,onConfirm:p,onCancel:j,children:g,dividers:v=!1,variant:y=X.Info,size:D=O.Sm})=>{const k=c?null:e.jsxs("div",{className:ps,children:[e.jsx(M,{variant:S.Secondary,title:o,onClick:()=>j?j():x?.()}),e.jsx(M,{variant:te[y].confirmVariant,cssClass:i,title:a,disable:u,onClick:()=>p()})]}),b=f.useCallback(()=>c?e.jsx("div",{className:"px-6 py-4 h-[120px]",children:e.jsx(re,{size:50})}):g??(t?e.jsx("div",{className:l(fs,n),children:t}):null),[g,t,c,n]);return e.jsx(ee,{open:r,title:s,cssClass:l(te[y].container,d),dividers:v,onClose:()=>x?.(),footer:k,size:D,children:b()})},se=({selectedItems:s,listCssClass:t,listElementCssClass:n})=>!!s?.length&&e.jsx("ul",{className:l("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:s?.map(r=>e.jsx("li",{className:l(["tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",n]),children:e.jsx(V,{tooltip:r,children:e.jsx("button",{"aria-label":"autocomplete-action",type:"button",className:"truncate w-full",children:r})})},r))}),ne=s=>L.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},L.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),xe=({children:s,open:t,disabled:n=!1,selectedValue:r,valueCssClasses:a,inputCssClasses:o,onOpen:c,elementId:u,errorText:d,emptyValueText:i})=>{const x=Array.isArray(r)&&r.length>0,p=typeof r=="string"&&!!r.trim(),j=x||p?r:i,g=n?void 0:c,v=()=>e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"w-full",onClick:g,"aria-label":"open-popup",id:u,children:e.jsxs("div",{className:l("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",o,n&&"dial-input-disable",d&&"dial-input-error"),children:[e.jsx(V,{tooltip:String(j),children:e.jsx("span",{className:a,children:j})}),!n&&e.jsx("div",{className:"flex-shrink-0",children:e.jsx(F,{icon:e.jsx(ne,{role:"img",width:_,height:_})})})]})}),d&&e.jsx($,{errorText:d})]}),y=()=>e.jsx("div",{className:"w-full",onClick:g,children:e.jsxs("div",{className:l("dial-input px-3 py-2 flex flex-row items-center w-full justify-between",n&&"dial-input-disable"),children:[e.jsx(se,{selectedItems:j}),!n&&e.jsx("div",{className:"ml-1",children:e.jsx(F,{icon:e.jsx(ne,{role:"img",width:_,height:_})})})]})});return e.jsxs(e.Fragment,{children:[x?y():v(),t&&ke.createPortal(s,document.body)]})},gs=({fieldTitle:s,htmlFor:t,disabled:n,selectedValue:r,radioButtons:a,customInputValue:o,valueCssClasses:c,inputCssClasses:u,emptyValueText:d,onClose:i,title:x,portalId:p,onApply:j,cancelButtonTitle:g="Cancel",applyButtonTitle:v="Apply",isValid:y,selectedRadioValue:D,onChangeRadioField:k,id:b,size:C=O.Md})=>{const[w,P]=f.useState(!1),B=f.useCallback(()=>{n||P(!0)},[n]),A=f.useCallback(()=>{P(!1),i?.()},[i]),E=f.useCallback(()=>{j(),A()},[j,A]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx(z,{fieldTitle:s,htmlFor:t}),e.jsx(xe,{disabled:n,open:w,selectedValue:o??a.find(I=>I.id===r)?.name,valueCssClasses:c,inputCssClasses:l(u,"py-2","px-3"),emptyValueText:d,onOpen:B,children:e.jsx(ee,{open:w,onClose:A,title:x,portalId:p,size:C,footer:e.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[e.jsx(M,{variant:S.Secondary,title:g,onClick:A}),e.jsx(M,{variant:S.Primary,title:v,onClick:E,disable:!y})]}),children:e.jsx("div",{className:"px-6 py-4",children:e.jsx(ie,{radioButtons:a,labelCssClass:"dial-small",activeRadioButton:D,onChange:k,elementId:b,orientation:K.Column})})})})]})},js=({onClick:s})=>e.jsx(N.IconEyeOff,{...G,className:"text-primary",onClick:s}),Cs=({onClick:s})=>e.jsx(N.IconEye,{...G,className:"text-primary",onClick:s}),pe=({...s})=>{const[t,n]=f.useState(!1),r=f.useCallback(a=>{n(a)},[]);return e.jsx(U,{type:t?"text":"password",...s,iconAfter:t?e.jsx(js,{onClick:()=>r(!1)}):e.jsx(Cs,{onClick:()=>r(!0)})})},ys=({fieldTitle:s,optional:t,elementCssClass:n,elementId:r,errorText:a,...o})=>e.jsxs("div",{className:"flex flex-col",children:[e.jsx(z,{fieldTitle:s,optional:t,htmlFor:r}),e.jsx(pe,{cssClass:n,elementId:r,invalid:!!a,...o}),e.jsx($,{errorText:a})]});var Z=(s=>(s.Small="small",s.Base="base",s))(Z||{});const bs={[Z.Small]:{textClass:"text-xs px-1",containerClass:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[Z.Base]:{textClass:"text-sm px-2",containerClass:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},vs=({elementId:s,value:t,placeholder:n,disabled:r,readonly:a,invalid:o,cssClass:c,containerCssClass:u,onChange:d,size:i=Z.Base})=>{const[x,p]=f.useState(t||"");f.useEffect(()=>{p(t||"")},[t]);const j=f.useCallback(y=>{p(y),d?.(y)},[d]),g=bs[i],v=f.useCallback(()=>{j("")},[j]);return e.jsxs("div",{className:l("dial-input flex flex-row items-center justify-between",o&&"dial-input-error",r&&"dial-input-disable",a&&"dial-input-readonly",g.containerClass,u),children:[e.jsx(F,{className:l(r?"text-secondary":"text-primary"),icon:e.jsx(N.IconSearch,{size:g.iconSize,stroke:g.iconStroke})}),e.jsx("input",{id:s,type:"text",autoComplete:"off",placeholder:n,value:x??"",disabled:r,readOnly:a,className:l("border-0 bg-transparent w-full",c,g.textClass),onChange:y=>!a&&j(y.currentTarget.value)}),x&&!a&&!r&&e.jsx(F,{className:"text-primary cursor-pointer",icon:e.jsx(N.IconX,{size:g.iconSize,stroke:g.iconStroke,onClick:v,"aria-label":"Clear search",role:"button"})})]})},ws=({placeholder:s="",selectedItems:t=[],updateSelected:n,listCssClass:r,listElementCssClass:a,containerCssClass:o,inputCssClass:c})=>{const[u,d]=f.useState(""),i=f.useCallback(p=>{p.key==="Enter"&&(n([...t,p.currentTarget.value]),d("")),(p.key==="Backspace"||p.key==="Delete")&&t.length&&!u&&n(t.slice(0,-1))},[t,n,u]),x=f.useCallback(p=>{d(p.target.value)},[d]);return e.jsxs("div",{className:l(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",o]),children:[e.jsx(se,{selectedItems:t,listCssClass:r,listElementCssClass:a}),e.jsx("input",{type:"text",value:u,className:l(["border-0 bg-transparent p-0",c]),placeholder:t?.length?"":s,onKeyDown:i,onChange:x})]})},Ns=({initialTags:s=[],fieldTitle:t,optional:n,elementId:r,placeholder:a,errorText:o,invalid:c,disabled:u,onChange:d})=>{const i=f.useRef(null),[x,p]=f.useState(s),[j,g]=f.useState(""),[v,y]=f.useState(!1),D=C=>{const w=C.trim().replace(/,$/,"");if(w&&!x.includes(w)){const P=[w,...x];p(P),d?.(P)}},k=C=>{(C.key===","||C.key==="Enter")&&(C.preventDefault(),D(j),g(""))},b=C=>{const w=x.filter((P,B)=>B!==C);p(w),d?.(w)};return f.useEffect(()=>{const C=new ResizeObserver(()=>{if(i.current){const w=i.current.scrollHeight>i.current.clientHeight+10;y(w)}});return i.current&&C.observe(i.current),()=>C.disconnect()},[x]),e.jsxs("div",{className:l("flex flex-col w-full"),children:[e.jsx(z,{fieldTitle:t,optional:n,htmlFor:r}),e.jsx("div",{className:l("dial-input min-h-[38px] p-[6px]",c&&"dial-input-error",u&&"dial-input-disable"),children:e.jsxs("div",{ref:i,className:l("flex flex-wrap gap-2 items-center",v?"flex-col-reverse":"flex-row"),children:[x.map((C,w)=>e.jsx(ce,{tag:C,remove:u?void 0:()=>b(w)},C+w)),e.jsx("input",{type:"text",value:j,onChange:C=>g(C.target.value),onKeyDown:k,className:l("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:a,disabled:u})]})}),e.jsx($,{errorText:o})]})};var fe=(s=>(s.Dropdown="dropdown",s.Menu="menu",s))(fe||{}),q=(s=>(s.Click="click",s.Hover="hover",s.ContextMenu="contextMenu",s))(q||{}),me=(s=>(s.Item="item",s.Divider="divider",s))(me||{});const ks=l("inline-flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Ds=l("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none","w-max"),Is=l("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),Ss="opacity-75 !cursor-not-allowed",Rs="text-error",Fs="my-1 border-t border-hover",Q=8,Es=({children:s,menu:t,renderOverlay:n,trigger:r=[q.Click],placement:a,disabled:o=!1,open:c,defaultOpen:u=!1,onOpenChange:d,closable:i=!1,onClose:x,cssClass:p,listClassName:j,outsidePressIgnoreRef:g,outsideClosable:v=!0})=>{const[y,D]=f.useState(u),k=c!==void 0,b=k?!!c:y,C=f.useCallback(m=>{k||D(m),d?.(m)},[k,d]),w=f.useId(),P=m=>m?"clientWidth"in m?m.clientWidth:m.getBoundingClientRect?.()?.width??0:0,B=a===void 0,{refs:A,floatingStyles:E,context:I}=h.useFloating({placement:a,open:b,onOpenChange:C,whileElementsMounted:h.autoUpdate,middleware:[h.offset({mainAxis:Q,crossAxis:0}),B?h.autoPlacement({alignment:"start",crossAxis:!0,padding:Q}):h.flip({padding:Q}),h.shift({padding:Q}),h.size({apply({availableWidth:m,elements:T}){const Ne=P(T.reference);T.floating.style.setProperty("--reference-width",`${Ne}px`),T.floating.style.maxWidth=`${m}px`}})]}),H=h.useClick(I,{enabled:r.includes(q.Click)&&!o}),he=h.useHover(I,{enabled:r.includes(q.Hover)&&!o,move:!1,restMs:40,delay:{open:80,close:80}}),ge=h.useDismiss(I,{bubbles:!0,referencePress:!1,outsidePress:m=>{if(!v)return!1;const T=m.target;return!(g?.current&&T instanceof Node&&g.current.contains(T))}}),je=h.useRole(I,{role:"menu"}),{getReferenceProps:Ce,getFloatingProps:ye}=h.useInteractions([H,he,ge,je]),be=m=>{!r.includes(q.ContextMenu)||o||(m.preventDefault(),C(!0))};f.useEffect(()=>{o&&b&&C(!1)},[o,b,C]);const ve=m=>T=>{m.disabled||(m.onClick?.({key:m.key,domEvent:T}),t?.onClick?.({key:m.key,domEvent:T}),C(!1))},we=n?n():t&&e.jsx("div",{role:"none",className:"py-1",children:t.items.map(m=>m.type===me.Divider?e.jsx("div",{role:"separator",className:Fs},m.key):e.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!m.disabled,className:l(Is,m.disabled&&Ss,m.danger&&Rs),disabled:m.disabled,onClick:ve(m),children:[m.icon&&e.jsx("span",{className:l(m.danger&&"text-error",m.disabled&&"text-secondary"),children:e.jsx(F,{icon:m.icon})}),e.jsx("span",{className:l("flex-1 truncate text-left",m.danger&&"text-error",m.disabled&&"text-secondary"),children:m.label})]},m.key))});return e.jsxs(e.Fragment,{children:[e.jsx("span",{ref:A.setReference,className:l(ks,o&&"!cursor-not-allowed opacity-75",p),"aria-haspopup":"menu","aria-expanded":b,"aria-controls":w,onContextMenu:be,...Ce(),children:s}),b&&e.jsx(h.FloatingPortal,{children:e.jsx(h.FloatingFocusManager,{context:I,modal:!1,initialFocus:-1,returnFocus:!0,children:e.jsxs("div",{id:w,ref:A.setFloating,style:E,className:l(Ds,j),...ye(),children:[i&&e.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:e.jsx(J,{ariaLabel:"Close dropdown",onClose:m=>{x?.(m),C(!1)}})}),we]})})})]})};exports.AlertVariant=W;exports.ButtonVariant=S;exports.ConfirmationPopupVariant=X;exports.DialAlert=Ee;exports.DialAutocompleteInput=ws;exports.DialAutocompleteInputValue=se;exports.DialButton=M;exports.DialCheckbox=ze;exports.DialCloseButton=J;exports.DialCollapsibleSidebar=Ye;exports.DialConfirmationPopup=hs;exports.DialDropdown=Es;exports.DialErrorText=$;exports.DialFieldLabel=z;exports.DialIcon=F;exports.DialInput=U;exports.DialInputPopup=xe;exports.DialLabelledText=Je;exports.DialLoader=re;exports.DialNoDataContent=Ze;exports.DialNumberInputField=as;exports.DialPasswordInput=pe;exports.DialPasswordInputField=ys;exports.DialPopup=ee;exports.DialRadioButton=le;exports.DialRadioGroup=ie;exports.DialRadioGroupPopupField=gs;exports.DialSearch=vs;exports.DialSteps=$e;exports.DialSwitch=is;exports.DialTag=ce;exports.DialTagInput=Ns;exports.DialTextAreaField=ls;exports.DialTextInputField=os;exports.DialTextarea=de;exports.DialTooltip=V;exports.DropdownType=fe;exports.PopupSize=O;exports.RadioGroupOrientation=K;exports.SearchSize=Z;exports.StepStatus=R;exports.TagVariant=Y;
|
package/dist/dial-ui-kit.es.js
CHANGED
|
@@ -2,8 +2,8 @@ import { jsx as r, jsxs as p, Fragment as Z } from "react/jsx-runtime";
|
|
|
2
2
|
import l from "classnames";
|
|
3
3
|
import { IconCircleCheck as Ae, IconAlertTriangle as Ve, IconAlertCircle as Oe, IconInfoCircle as je, IconX as J, IconMinus as We, IconCheck as ce, IconExclamationCircle as Be, IconClipboardX as ze, IconChevronsLeft as He, IconChevronsRight as _e, IconEyeOff as $e, IconEye as Ge, IconSearch as Ke } from "@tabler/icons-react";
|
|
4
4
|
import * as L from "react";
|
|
5
|
-
import { createContext as Ue, useState as F, useRef as de, useMemo as Ze, useContext as Xe, forwardRef as ue, isValidElement as qe, cloneElement as Qe, useCallback as
|
|
6
|
-
import { useFloating as re, offset as pe, flip as fe, shift as me, arrow as Je, autoUpdate as he, useHover as xe, useFocus as er, useDismiss as ne, useRole as te, useInteractions as se, useMergeRefs as ge, FloatingPortal as ae, FloatingArrow as rr, FloatingOverlay as nr, FloatingFocusManager as
|
|
5
|
+
import { createContext as Ue, useState as F, useRef as de, useMemo as Ze, useContext as Xe, forwardRef as ue, isValidElement as qe, cloneElement as Qe, useCallback as E, useEffect as ee, useId as Ye } from "react";
|
|
6
|
+
import { useFloating as re, offset as pe, flip as fe, shift as me, arrow as Je, autoUpdate as he, useHover as xe, useFocus as er, useDismiss as ne, useRole as te, useInteractions as se, useMergeRefs as ge, FloatingPortal as ae, FloatingArrow as rr, FloatingOverlay as nr, FloatingFocusManager as ye, autoPlacement as tr, size as sr, useClick as ar } from "@floating-ui/react";
|
|
7
7
|
import { createPortal as or } from "react-dom";
|
|
8
8
|
const K = ({ errorText: e }) => e && /* @__PURE__ */ r("span", { className: "text-error dial-tiny mt-1", children: e }), $ = ({
|
|
9
9
|
fieldTitle: e,
|
|
@@ -26,12 +26,12 @@ const K = ({ errorText: e }) => e && /* @__PURE__ */ r("span", { className: "tex
|
|
|
26
26
|
]
|
|
27
27
|
}
|
|
28
28
|
) : null, M = ({ icon: e, className: n }) => e ? /* @__PURE__ */ r("span", { className: l("flex-shrink-0", n), children: e }) : null;
|
|
29
|
-
var
|
|
29
|
+
var I = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e.Danger = "danger", e))(I || {});
|
|
30
30
|
const lr = {
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
31
|
+
[I.Primary]: "dial-primary-button",
|
|
32
|
+
[I.Secondary]: "dial-secondary-button",
|
|
33
|
+
[I.Tertiary]: "dial-tertiary-button",
|
|
34
|
+
[I.Danger]: "dial-danger-button"
|
|
35
35
|
}, V = ({
|
|
36
36
|
title: e,
|
|
37
37
|
variant: n,
|
|
@@ -73,19 +73,19 @@ const lr = {
|
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
};
|
|
76
|
-
var
|
|
76
|
+
var z = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(z || {});
|
|
77
77
|
const ir = {
|
|
78
78
|
info: /* @__PURE__ */ r(je, { size: 24, stroke: 2 }),
|
|
79
79
|
error: /* @__PURE__ */ r(Oe, { size: 24, stroke: 2 }),
|
|
80
80
|
warning: /* @__PURE__ */ r(Ve, { size: 24, stroke: 2 }),
|
|
81
81
|
success: /* @__PURE__ */ r(Ae, { size: 24, stroke: 2 })
|
|
82
82
|
}, cr = {
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
86
|
-
[
|
|
83
|
+
[z.Info]: "bg-info border-info text-info",
|
|
84
|
+
[z.Success]: "bg-success border-success text-success",
|
|
85
|
+
[z.Warning]: "bg-warning border-warning text-warning",
|
|
86
|
+
[z.Error]: "bg-error border-error text-error"
|
|
87
87
|
}, dr = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", dn = ({
|
|
88
|
-
variant: e =
|
|
88
|
+
variant: e = z.Info,
|
|
89
89
|
message: n,
|
|
90
90
|
cssClass: t,
|
|
91
91
|
closable: s = !1,
|
|
@@ -146,8 +146,8 @@ const ir = {
|
|
|
146
146
|
}
|
|
147
147
|
)
|
|
148
148
|
}
|
|
149
|
-
), hr = 7, xr = 2,
|
|
150
|
-
const e = Xe(
|
|
149
|
+
), hr = 7, xr = 2, Ce = Ue(null), be = () => {
|
|
150
|
+
const e = Xe(Ce);
|
|
151
151
|
if (e == null)
|
|
152
152
|
throw new Error("Tooltip components must be wrapped in <Tooltip />");
|
|
153
153
|
return e;
|
|
@@ -182,24 +182,24 @@ const ir = {
|
|
|
182
182
|
delay: { open: 500, close: 0 }
|
|
183
183
|
}), g = er(f.context, {
|
|
184
184
|
enabled: s == null
|
|
185
|
-
}), x = ne(f.context), v = te(f.context, { role: "tooltip" }),
|
|
185
|
+
}), x = ne(f.context), v = te(f.context, { role: "tooltip" }), C = se([m, g, x, v]);
|
|
186
186
|
return Ze(
|
|
187
187
|
() => ({
|
|
188
188
|
open: d,
|
|
189
189
|
setOpen: i,
|
|
190
190
|
arrowRef: u,
|
|
191
|
-
...
|
|
191
|
+
...C,
|
|
192
192
|
...f
|
|
193
193
|
}),
|
|
194
|
-
[d, i,
|
|
194
|
+
[d, i, C, f]
|
|
195
195
|
);
|
|
196
|
-
},
|
|
196
|
+
}, yr = ({
|
|
197
197
|
children: e,
|
|
198
198
|
...n
|
|
199
199
|
}) => {
|
|
200
200
|
const t = gr(n);
|
|
201
|
-
return /* @__PURE__ */ r(
|
|
202
|
-
},
|
|
201
|
+
return /* @__PURE__ */ r(Ce.Provider, { value: t, children: e });
|
|
202
|
+
}, Cr = ue(function({ style: n, ...t }, s) {
|
|
203
203
|
const a = be(), o = ge([a.refs.setFloating, s]);
|
|
204
204
|
return a.open ? /* @__PURE__ */ r(ae, { id: "tooltip-portal", children: /* @__PURE__ */ p(
|
|
205
205
|
"div",
|
|
@@ -247,17 +247,17 @@ const ir = {
|
|
|
247
247
|
children: n
|
|
248
248
|
}
|
|
249
249
|
);
|
|
250
|
-
}),
|
|
250
|
+
}), W = ({
|
|
251
251
|
hideTooltip: e,
|
|
252
252
|
tooltip: n,
|
|
253
253
|
children: t,
|
|
254
254
|
triggerClassName: s,
|
|
255
255
|
contentClassName: a,
|
|
256
256
|
...o
|
|
257
|
-
}) => /* @__PURE__ */ p(
|
|
257
|
+
}) => /* @__PURE__ */ p(yr, { ...o, children: [
|
|
258
258
|
/* @__PURE__ */ r(br, { className: l(s, "truncate"), children: t }),
|
|
259
259
|
/* @__PURE__ */ r(
|
|
260
|
-
|
|
260
|
+
Cr,
|
|
261
261
|
{
|
|
262
262
|
className: l(
|
|
263
263
|
"text-primary",
|
|
@@ -268,8 +268,8 @@ const ir = {
|
|
|
268
268
|
children: n
|
|
269
269
|
}
|
|
270
270
|
)
|
|
271
|
-
] }),
|
|
272
|
-
size:
|
|
271
|
+
] }), H = 18, _ = {
|
|
272
|
+
size: H,
|
|
273
273
|
stroke: 2
|
|
274
274
|
}, un = ({
|
|
275
275
|
label: e,
|
|
@@ -280,7 +280,7 @@ const ir = {
|
|
|
280
280
|
ariaLabel: o,
|
|
281
281
|
onChange: c
|
|
282
282
|
}) => {
|
|
283
|
-
const u =
|
|
283
|
+
const u = E(
|
|
284
284
|
(m) => {
|
|
285
285
|
c?.(m.target.checked, n);
|
|
286
286
|
},
|
|
@@ -295,7 +295,7 @@ const ir = {
|
|
|
295
295
|
);
|
|
296
296
|
return /* @__PURE__ */ p("label", { className: d, htmlFor: n, children: [
|
|
297
297
|
s ? /* @__PURE__ */ r(We, { className: i, ..._ }) : t ? /* @__PURE__ */ r(ce, { className: i, ..._ }) : null,
|
|
298
|
-
e && /* @__PURE__ */ r(
|
|
298
|
+
e && /* @__PURE__ */ r(W, { tooltip: e, triggerClassName: "flex-1 min-w-0", children: /* @__PURE__ */ r("p", { className: "text-primary w-full truncate", children: e }) }),
|
|
299
299
|
/* @__PURE__ */ r(
|
|
300
300
|
"input",
|
|
301
301
|
{
|
|
@@ -313,21 +313,21 @@ const ir = {
|
|
|
313
313
|
)
|
|
314
314
|
] });
|
|
315
315
|
};
|
|
316
|
-
var
|
|
316
|
+
var R = /* @__PURE__ */ ((e) => (e.VALID = "valid", e.ERROR = "error", e))(R || {});
|
|
317
317
|
const vr = (e, n) => {
|
|
318
318
|
if (n === e.id)
|
|
319
319
|
switch (e.status) {
|
|
320
|
-
case
|
|
320
|
+
case R.VALID:
|
|
321
321
|
return "border-accent-secondary text-primary";
|
|
322
|
-
case
|
|
322
|
+
case R.ERROR:
|
|
323
323
|
return "border-red-900 text-primary";
|
|
324
324
|
default:
|
|
325
325
|
return "border-accent-primary text-primary";
|
|
326
326
|
}
|
|
327
327
|
switch (e.status) {
|
|
328
|
-
case
|
|
328
|
+
case R.VALID:
|
|
329
329
|
return "border-primary text-white";
|
|
330
|
-
case
|
|
330
|
+
case R.ERROR:
|
|
331
331
|
return "border-red-900 text-error";
|
|
332
332
|
default:
|
|
333
333
|
return "border-primary text-secondary";
|
|
@@ -335,17 +335,17 @@ const vr = (e, n) => {
|
|
|
335
335
|
}, wr = (e, n) => {
|
|
336
336
|
if (n === e.id)
|
|
337
337
|
switch (e.status) {
|
|
338
|
-
case
|
|
338
|
+
case R.VALID:
|
|
339
339
|
return "bg-accent-secondary";
|
|
340
|
-
case
|
|
340
|
+
case R.ERROR:
|
|
341
341
|
return "bg-red-400";
|
|
342
342
|
default:
|
|
343
343
|
return "bg-accent-primary";
|
|
344
344
|
}
|
|
345
345
|
switch (e.status) {
|
|
346
|
-
case
|
|
346
|
+
case R.VALID:
|
|
347
347
|
return "bg-accent-secondary";
|
|
348
|
-
case
|
|
348
|
+
case R.ERROR:
|
|
349
349
|
return "bg-red-400";
|
|
350
350
|
default:
|
|
351
351
|
return "bg-layer-4";
|
|
@@ -356,7 +356,7 @@ const vr = (e, n) => {
|
|
|
356
356
|
currentStep: t,
|
|
357
357
|
onChangeStep: s
|
|
358
358
|
}) => {
|
|
359
|
-
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", c = () => t === e.id && e.status ===
|
|
359
|
+
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", c = () => t === e.id && e.status === R.ERROR ? /* @__PURE__ */ r(Be, { stroke: 2, size: 16 }) : t !== e.id && e.status === R.VALID ? /* @__PURE__ */ r(ce, { stroke: 2, size: 16 }) : n + 1;
|
|
360
360
|
return /* @__PURE__ */ p(
|
|
361
361
|
"button",
|
|
362
362
|
{
|
|
@@ -381,7 +381,7 @@ const vr = (e, n) => {
|
|
|
381
381
|
}) => {
|
|
382
382
|
const s = (a) => {
|
|
383
383
|
const o = e.findIndex((u) => u.id === n), c = e.findIndex((u) => u.id === a);
|
|
384
|
-
(a !== n && e[o].status ===
|
|
384
|
+
(a !== n && e[o].status === R.VALID || c < o) && t(a);
|
|
385
385
|
};
|
|
386
386
|
return /* @__PURE__ */ r("div", { id: "steps", className: "flex gap-x-3", children: e.map((a, o) => /* @__PURE__ */ r(
|
|
387
387
|
Nr,
|
|
@@ -414,7 +414,7 @@ const vr = (e, n) => {
|
|
|
414
414
|
"cursor-pointer dial-input-radio",
|
|
415
415
|
t && "mr-2",
|
|
416
416
|
c
|
|
417
|
-
), v = l("flex flex-col", !!s && "mb-2"),
|
|
417
|
+
), v = l("flex flex-col", !!s && "mb-2"), C = l(
|
|
418
418
|
"dial-tiny mt-2 ml-[26px] text-secondary",
|
|
419
419
|
f
|
|
420
420
|
);
|
|
@@ -438,7 +438,7 @@ const vr = (e, n) => {
|
|
|
438
438
|
),
|
|
439
439
|
t ? /* @__PURE__ */ r("label", { className: g, htmlFor: o, children: t }) : null
|
|
440
440
|
] }),
|
|
441
|
-
a && s && /* @__PURE__ */ r("div", { id: m, className:
|
|
441
|
+
a && s && /* @__PURE__ */ r("div", { id: m, className: C, children: s })
|
|
442
442
|
] });
|
|
443
443
|
};
|
|
444
444
|
var X = /* @__PURE__ */ ((e) => (e.Row = "Row", e.Column = "Column", e))(X || {});
|
|
@@ -499,7 +499,7 @@ const Dr = "flex flex-col gap-2", Ir = "flex", Rr = "pb-1 mt-2", Er = {
|
|
|
499
499
|
children: n,
|
|
500
500
|
width: t,
|
|
501
501
|
title: s,
|
|
502
|
-
iconSize: a =
|
|
502
|
+
iconSize: a = H,
|
|
503
503
|
titleCssClass: o,
|
|
504
504
|
additionalButtons: c
|
|
505
505
|
}) => {
|
|
@@ -571,7 +571,7 @@ const Dr = "flex flex-col gap-2", Ir = "flex", Rr = "pb-1 mt-2", Er = {
|
|
|
571
571
|
children: [
|
|
572
572
|
/* @__PURE__ */ r("label", { className: "dial-tiny mb-2 text-secondary", children: e }),
|
|
573
573
|
t || /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
|
|
574
|
-
/* @__PURE__ */ r(
|
|
574
|
+
/* @__PURE__ */ r(W, { triggerClassName: "text-primary", tooltip: n, children: n }),
|
|
575
575
|
s || null
|
|
576
576
|
] })
|
|
577
577
|
]
|
|
@@ -618,7 +618,7 @@ const Fr = {
|
|
|
618
618
|
invalid: o,
|
|
619
619
|
readonly: c,
|
|
620
620
|
onChange: u
|
|
621
|
-
}) => /* @__PURE__ */ r(
|
|
621
|
+
}) => /* @__PURE__ */ r(W, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ r(
|
|
622
622
|
"textarea",
|
|
623
623
|
{
|
|
624
624
|
id: n,
|
|
@@ -682,22 +682,22 @@ const Fr = {
|
|
|
682
682
|
invalid: g,
|
|
683
683
|
onChange: x,
|
|
684
684
|
min: v,
|
|
685
|
-
max:
|
|
685
|
+
max: C,
|
|
686
686
|
prefix: k,
|
|
687
687
|
suffix: N,
|
|
688
688
|
textBeforeInput: b,
|
|
689
|
-
textAfterInput:
|
|
689
|
+
textAfterInput: y
|
|
690
690
|
}) => {
|
|
691
|
-
const w = (
|
|
692
|
-
Ar(
|
|
693
|
-
},
|
|
694
|
-
const
|
|
695
|
-
if (
|
|
696
|
-
const
|
|
697
|
-
if (isNaN(
|
|
691
|
+
const w = (S) => S.target.blur(), P = i === "number" || v !== void 0 || C !== void 0, O = (S) => {
|
|
692
|
+
Ar(S, i, v, C);
|
|
693
|
+
}, A = (S) => {
|
|
694
|
+
const D = S.currentTarget.value;
|
|
695
|
+
if (P && D !== "") {
|
|
696
|
+
const B = parseFloat(D);
|
|
697
|
+
if (isNaN(B) && D !== "-" && D !== "." || !isNaN(B) && (v !== void 0 && B < v || C !== void 0 && B > C))
|
|
698
698
|
return;
|
|
699
699
|
}
|
|
700
|
-
x?.(
|
|
700
|
+
x?.(D);
|
|
701
701
|
};
|
|
702
702
|
return /* @__PURE__ */ p(
|
|
703
703
|
"div",
|
|
@@ -709,7 +709,7 @@ const Fr = {
|
|
|
709
709
|
f && "dial-input-disable",
|
|
710
710
|
m && "dial-input-readonly",
|
|
711
711
|
!b && "pl-3",
|
|
712
|
-
!
|
|
712
|
+
!y && "pr-3",
|
|
713
713
|
u
|
|
714
714
|
),
|
|
715
715
|
children: [
|
|
@@ -730,7 +730,7 @@ const Fr = {
|
|
|
730
730
|
] }),
|
|
731
731
|
/* @__PURE__ */ r(M, { icon: e }),
|
|
732
732
|
/* @__PURE__ */ r(
|
|
733
|
-
|
|
733
|
+
W,
|
|
734
734
|
{
|
|
735
735
|
tooltip: s,
|
|
736
736
|
triggerClassName: l(d, "flex-1"),
|
|
@@ -744,11 +744,11 @@ const Fr = {
|
|
|
744
744
|
value: s ?? "",
|
|
745
745
|
disabled: f,
|
|
746
746
|
className: l("border-0 bg-transparent", c),
|
|
747
|
-
onChange: (
|
|
748
|
-
onKeyDown:
|
|
747
|
+
onChange: (S) => !m && A?.(S),
|
|
748
|
+
onKeyDown: O,
|
|
749
749
|
onWheel: w,
|
|
750
750
|
min: v,
|
|
751
|
-
max:
|
|
751
|
+
max: C
|
|
752
752
|
}
|
|
753
753
|
)
|
|
754
754
|
}
|
|
@@ -758,14 +758,14 @@ const Fr = {
|
|
|
758
758
|
" ",
|
|
759
759
|
N
|
|
760
760
|
] }),
|
|
761
|
-
|
|
761
|
+
y && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
762
762
|
q,
|
|
763
763
|
{
|
|
764
764
|
hideBorder: !0,
|
|
765
765
|
containerCssClass: "rounded-l-none border-l-0",
|
|
766
|
-
value:
|
|
766
|
+
value: y,
|
|
767
767
|
disabled: !0,
|
|
768
|
-
elementId:
|
|
768
|
+
elementId: y + "textAfter"
|
|
769
769
|
}
|
|
770
770
|
) })
|
|
771
771
|
]
|
|
@@ -837,7 +837,7 @@ const Fr = {
|
|
|
837
837
|
onChange: (t) => e?.(t),
|
|
838
838
|
...n
|
|
839
839
|
}
|
|
840
|
-
),
|
|
840
|
+
), yn = ({
|
|
841
841
|
fieldTitle: e,
|
|
842
842
|
optional: n,
|
|
843
843
|
elementId: t,
|
|
@@ -862,7 +862,7 @@ const Fr = {
|
|
|
862
862
|
}
|
|
863
863
|
),
|
|
864
864
|
/* @__PURE__ */ r(K, { errorText: a })
|
|
865
|
-
] }),
|
|
865
|
+
] }), Cn = ({
|
|
866
866
|
title: e,
|
|
867
867
|
switchId: n,
|
|
868
868
|
isOn: t = !1,
|
|
@@ -874,7 +874,7 @@ const Fr = {
|
|
|
874
874
|
t ? "flex-row-reverse" : "flex-row",
|
|
875
875
|
s ? "pointer-events-none" : "",
|
|
876
876
|
s ? t ? "bg-controls-disable" : "bg-layer-4" : t ? "bg-accent-primary" : "bg-layer-4"
|
|
877
|
-
), c =
|
|
877
|
+
), c = E(
|
|
878
878
|
(u) => {
|
|
879
879
|
u.stopPropagation(), a?.(!t);
|
|
880
880
|
},
|
|
@@ -904,11 +904,11 @@ const Fr = {
|
|
|
904
904
|
e && /* @__PURE__ */ r("span", { className: "pl-2 dial-small text-primary", children: e })
|
|
905
905
|
] });
|
|
906
906
|
};
|
|
907
|
-
var
|
|
907
|
+
var j = /* @__PURE__ */ ((e) => (e.Sm = "sm", e.Md = "md", e.Lg = "lg", e))(j || {});
|
|
908
908
|
const jr = "z-[52] flex items-center justify-center bg-blackout md:p-4", Wr = "divide-tertiary divide-y", Br = "flex flex-row justify-between py-4 px-6 items-center", zr = {
|
|
909
|
-
[
|
|
910
|
-
[
|
|
911
|
-
[
|
|
909
|
+
[j.Sm]: "dial-sm-popup",
|
|
910
|
+
[j.Md]: "dial-md-popup",
|
|
911
|
+
[j.Lg]: "dial-lg-popup"
|
|
912
912
|
}, Ne = ({
|
|
913
913
|
open: e = !1,
|
|
914
914
|
title: n,
|
|
@@ -920,14 +920,14 @@ const jr = "z-[52] flex items-center justify-center bg-blackout md:p-4", Wr = "d
|
|
|
920
920
|
children: u,
|
|
921
921
|
footer: d,
|
|
922
922
|
onClose: i,
|
|
923
|
-
size: f =
|
|
923
|
+
size: f = j.Md
|
|
924
924
|
}) => {
|
|
925
925
|
const { refs: m, context: g } = re({
|
|
926
926
|
open: e,
|
|
927
927
|
onOpenChange: (b) => {
|
|
928
928
|
b || i?.(null);
|
|
929
929
|
}
|
|
930
|
-
}), x = te(g, { role: "dialog" }), v = ne(g, { outsidePress: !0 }), { getFloatingProps:
|
|
930
|
+
}), x = te(g, { role: "dialog" }), v = ne(g, { outsidePress: !0 }), { getFloatingProps: C } = se([x, v]);
|
|
931
931
|
if (!e) return null;
|
|
932
932
|
const k = typeof n == "string" ? "dial-popup-heading" : void 0, N = (b) => b ? typeof b == "string" ? /* @__PURE__ */ r(
|
|
933
933
|
"h3",
|
|
@@ -937,14 +937,14 @@ const jr = "z-[52] flex items-center justify-center bg-blackout md:p-4", Wr = "d
|
|
|
937
937
|
"flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",
|
|
938
938
|
o
|
|
939
939
|
),
|
|
940
|
-
children: /* @__PURE__ */ r(
|
|
940
|
+
children: /* @__PURE__ */ r(W, { tooltip: b, children: b })
|
|
941
941
|
}
|
|
942
942
|
) : b : /* @__PURE__ */ r("span", {});
|
|
943
|
-
return /* @__PURE__ */ r(ae, { id: t, children: /* @__PURE__ */ r(nr, { className: l(jr, a), children: /* @__PURE__ */ r(
|
|
943
|
+
return /* @__PURE__ */ r(ae, { id: t, children: /* @__PURE__ */ r(nr, { className: l(jr, a), children: /* @__PURE__ */ r(ye, { context: g, children: /* @__PURE__ */ p(
|
|
944
944
|
"div",
|
|
945
945
|
{
|
|
946
946
|
ref: m.setFloating,
|
|
947
|
-
...
|
|
947
|
+
...C(),
|
|
948
948
|
role: "dialog",
|
|
949
949
|
"aria-modal": "true",
|
|
950
950
|
"aria-labelledby": k,
|
|
@@ -974,13 +974,13 @@ const jr = "z-[52] flex items-center justify-center bg-blackout md:p-4", Wr = "d
|
|
|
974
974
|
var Q = /* @__PURE__ */ ((e) => (e.Info = "info", e.Danger = "danger", e))(Q || {});
|
|
975
975
|
const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-150 px-6 py-4", $r = "Cancel", le = {
|
|
976
976
|
[Q.Info]: {
|
|
977
|
-
confirmVariant:
|
|
978
|
-
cancelVariant:
|
|
977
|
+
confirmVariant: I.Primary,
|
|
978
|
+
cancelVariant: I.Secondary
|
|
979
979
|
},
|
|
980
980
|
[Q.Danger]: {
|
|
981
981
|
container: "border-t-4 border-error",
|
|
982
|
-
confirmVariant:
|
|
983
|
-
cancelVariant:
|
|
982
|
+
confirmVariant: I.Danger,
|
|
983
|
+
cancelVariant: I.Secondary
|
|
984
984
|
}
|
|
985
985
|
}, bn = ({
|
|
986
986
|
title: e,
|
|
@@ -998,14 +998,14 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
998
998
|
onCancel: g,
|
|
999
999
|
children: x,
|
|
1000
1000
|
dividers: v = !1,
|
|
1001
|
-
variant:
|
|
1002
|
-
size: k =
|
|
1001
|
+
variant: C = Q.Info,
|
|
1002
|
+
size: k = j.Sm
|
|
1003
1003
|
}) => {
|
|
1004
1004
|
const N = c ? null : /* @__PURE__ */ p("div", { className: Hr, children: [
|
|
1005
1005
|
/* @__PURE__ */ r(
|
|
1006
1006
|
V,
|
|
1007
1007
|
{
|
|
1008
|
-
variant:
|
|
1008
|
+
variant: I.Secondary,
|
|
1009
1009
|
title: o,
|
|
1010
1010
|
onClick: () => g ? g() : f?.()
|
|
1011
1011
|
}
|
|
@@ -1013,14 +1013,14 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1013
1013
|
/* @__PURE__ */ r(
|
|
1014
1014
|
V,
|
|
1015
1015
|
{
|
|
1016
|
-
variant: le[
|
|
1016
|
+
variant: le[C].confirmVariant,
|
|
1017
1017
|
cssClass: i,
|
|
1018
1018
|
title: a,
|
|
1019
1019
|
disable: u,
|
|
1020
1020
|
onClick: () => m()
|
|
1021
1021
|
}
|
|
1022
1022
|
)
|
|
1023
|
-
] }), b =
|
|
1023
|
+
] }), b = E(() => c ? /* @__PURE__ */ r("div", { className: "px-6 py-4 h-[120px]", children: /* @__PURE__ */ r(mr, { size: 50 }) }) : x ?? (n ? /* @__PURE__ */ r(
|
|
1024
1024
|
"div",
|
|
1025
1025
|
{
|
|
1026
1026
|
className: l(_r, t),
|
|
@@ -1032,7 +1032,7 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1032
1032
|
{
|
|
1033
1033
|
open: s,
|
|
1034
1034
|
title: e,
|
|
1035
|
-
cssClass: l(le[
|
|
1035
|
+
cssClass: l(le[C].container, d),
|
|
1036
1036
|
dividers: v,
|
|
1037
1037
|
onClose: () => f?.(),
|
|
1038
1038
|
footer: N,
|
|
@@ -1055,7 +1055,7 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1055
1055
|
"tiny bg-layer-3 rounded p-1 border border-primary max-w-[200px] truncate",
|
|
1056
1056
|
t
|
|
1057
1057
|
]),
|
|
1058
|
-
children: /* @__PURE__ */ r(
|
|
1058
|
+
children: /* @__PURE__ */ r(W, { tooltip: s, children: /* @__PURE__ */ r(
|
|
1059
1059
|
"button",
|
|
1060
1060
|
{
|
|
1061
1061
|
"aria-label": "autocomplete-action",
|
|
@@ -1071,7 +1071,7 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1071
1071
|
), ie = (e) => /* @__PURE__ */ L.createElement("svg", { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z", fill: "currentColor" })), Gr = ({
|
|
1072
1072
|
children: e,
|
|
1073
1073
|
open: n,
|
|
1074
|
-
|
|
1074
|
+
disabled: t = !1,
|
|
1075
1075
|
selectedValue: s,
|
|
1076
1076
|
valueCssClasses: a,
|
|
1077
1077
|
inputCssClasses: o,
|
|
@@ -1098,8 +1098,8 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1098
1098
|
ie,
|
|
1099
1099
|
{
|
|
1100
1100
|
role: "img",
|
|
1101
|
-
width:
|
|
1102
|
-
height:
|
|
1101
|
+
width: H,
|
|
1102
|
+
height: H
|
|
1103
1103
|
}
|
|
1104
1104
|
)
|
|
1105
1105
|
}
|
|
@@ -1125,7 +1125,7 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1125
1125
|
d && "dial-input-error"
|
|
1126
1126
|
),
|
|
1127
1127
|
children: [
|
|
1128
|
-
/* @__PURE__ */ r(
|
|
1128
|
+
/* @__PURE__ */ r(W, { tooltip: String(g), children: /* @__PURE__ */ r("span", { className: a, children: g }) }),
|
|
1129
1129
|
!t && /* @__PURE__ */ r("div", { className: "flex-shrink-0", children: /* @__PURE__ */ r(
|
|
1130
1130
|
M,
|
|
1131
1131
|
{
|
|
@@ -1133,8 +1133,8 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1133
1133
|
ie,
|
|
1134
1134
|
{
|
|
1135
1135
|
role: "img",
|
|
1136
|
-
width:
|
|
1137
|
-
height:
|
|
1136
|
+
width: H,
|
|
1137
|
+
height: H
|
|
1138
1138
|
}
|
|
1139
1139
|
)
|
|
1140
1140
|
}
|
|
@@ -1151,7 +1151,7 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1151
1151
|
}, vn = ({
|
|
1152
1152
|
fieldTitle: e,
|
|
1153
1153
|
htmlFor: n,
|
|
1154
|
-
|
|
1154
|
+
disabled: t,
|
|
1155
1155
|
selectedValue: s,
|
|
1156
1156
|
radioButtons: a,
|
|
1157
1157
|
customInputValue: o,
|
|
@@ -1164,53 +1164,55 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1164
1164
|
onApply: g,
|
|
1165
1165
|
cancelButtonTitle: x = "Cancel",
|
|
1166
1166
|
applyButtonTitle: v = "Apply",
|
|
1167
|
-
isValid:
|
|
1167
|
+
isValid: C,
|
|
1168
1168
|
selectedRadioValue: k,
|
|
1169
1169
|
onChangeRadioField: N,
|
|
1170
|
-
id: b
|
|
1170
|
+
id: b,
|
|
1171
|
+
size: y = j.Md
|
|
1171
1172
|
}) => {
|
|
1172
|
-
const [
|
|
1173
|
-
t ||
|
|
1174
|
-
}, [t]),
|
|
1175
|
-
|
|
1176
|
-
}, [i]),
|
|
1177
|
-
g(),
|
|
1178
|
-
}, [g,
|
|
1173
|
+
const [w, P] = F(!1), O = E(() => {
|
|
1174
|
+
t || P(!0);
|
|
1175
|
+
}, [t]), A = E(() => {
|
|
1176
|
+
P(!1), i?.();
|
|
1177
|
+
}, [i]), S = E(() => {
|
|
1178
|
+
g(), A();
|
|
1179
|
+
}, [g, A]);
|
|
1179
1180
|
return /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
|
|
1180
1181
|
/* @__PURE__ */ r($, { fieldTitle: e, htmlFor: n }),
|
|
1181
1182
|
/* @__PURE__ */ r(
|
|
1182
1183
|
Gr,
|
|
1183
1184
|
{
|
|
1184
|
-
|
|
1185
|
-
open:
|
|
1186
|
-
selectedValue: o ?? a.find((
|
|
1185
|
+
disabled: t,
|
|
1186
|
+
open: w,
|
|
1187
|
+
selectedValue: o ?? a.find((D) => D.id === s)?.name,
|
|
1187
1188
|
valueCssClasses: c,
|
|
1188
1189
|
inputCssClasses: l(u, "py-2", "px-3"),
|
|
1189
1190
|
emptyValueText: d,
|
|
1190
|
-
onOpen:
|
|
1191
|
+
onOpen: O,
|
|
1191
1192
|
children: /* @__PURE__ */ r(
|
|
1192
1193
|
Ne,
|
|
1193
1194
|
{
|
|
1194
|
-
open:
|
|
1195
|
-
onClose:
|
|
1195
|
+
open: w,
|
|
1196
|
+
onClose: A,
|
|
1196
1197
|
title: f,
|
|
1197
1198
|
portalId: m,
|
|
1199
|
+
size: y,
|
|
1198
1200
|
footer: /* @__PURE__ */ p("div", { className: "flex flex-row items-center justify-end gap-2 px-6 py-4", children: [
|
|
1199
1201
|
/* @__PURE__ */ r(
|
|
1200
1202
|
V,
|
|
1201
1203
|
{
|
|
1202
|
-
variant:
|
|
1204
|
+
variant: I.Secondary,
|
|
1203
1205
|
title: x,
|
|
1204
|
-
onClick:
|
|
1206
|
+
onClick: A
|
|
1205
1207
|
}
|
|
1206
1208
|
),
|
|
1207
1209
|
/* @__PURE__ */ r(
|
|
1208
1210
|
V,
|
|
1209
1211
|
{
|
|
1210
|
-
variant:
|
|
1212
|
+
variant: I.Primary,
|
|
1211
1213
|
title: v,
|
|
1212
|
-
onClick:
|
|
1213
|
-
disable: !
|
|
1214
|
+
onClick: S,
|
|
1215
|
+
disable: !C
|
|
1214
1216
|
}
|
|
1215
1217
|
)
|
|
1216
1218
|
] }),
|
|
@@ -1238,7 +1240,7 @@ const Hr = "flex justify-end gap-2 px-6 py-4", _r = "text-secondary dial-small-1
|
|
|
1238
1240
|
onClick: e
|
|
1239
1241
|
}
|
|
1240
1242
|
), Ur = ({ onClick: e }) => /* @__PURE__ */ r(Ge, { ..._, className: "text-primary", onClick: e }), Zr = ({ ...e }) => {
|
|
1241
|
-
const [n, t] = F(!1), s =
|
|
1243
|
+
const [n, t] = F(!1), s = E((a) => {
|
|
1242
1244
|
t(a);
|
|
1243
1245
|
}, []);
|
|
1244
1246
|
return /* @__PURE__ */ r(
|
|
@@ -1306,12 +1308,12 @@ const Xr = {
|
|
|
1306
1308
|
ee(() => {
|
|
1307
1309
|
m(n || "");
|
|
1308
1310
|
}, [n]);
|
|
1309
|
-
const g =
|
|
1310
|
-
(
|
|
1311
|
-
m(
|
|
1311
|
+
const g = E(
|
|
1312
|
+
(C) => {
|
|
1313
|
+
m(C), d?.(C);
|
|
1312
1314
|
},
|
|
1313
1315
|
[d]
|
|
1314
|
-
), x = Xr[i], v =
|
|
1316
|
+
), x = Xr[i], v = E(() => {
|
|
1315
1317
|
g("");
|
|
1316
1318
|
}, [g]);
|
|
1317
1319
|
return /* @__PURE__ */ p(
|
|
@@ -1354,7 +1356,7 @@ const Xr = {
|
|
|
1354
1356
|
c,
|
|
1355
1357
|
x.textClass
|
|
1356
1358
|
),
|
|
1357
|
-
onChange: (
|
|
1359
|
+
onChange: (C) => !a && g(C.currentTarget.value)
|
|
1358
1360
|
}
|
|
1359
1361
|
),
|
|
1360
1362
|
f && !a && !s && /* @__PURE__ */ r(
|
|
@@ -1385,12 +1387,12 @@ const Xr = {
|
|
|
1385
1387
|
containerCssClass: o,
|
|
1386
1388
|
inputCssClass: c
|
|
1387
1389
|
}) => {
|
|
1388
|
-
const [u, d] = F(""), i =
|
|
1390
|
+
const [u, d] = F(""), i = E(
|
|
1389
1391
|
(m) => {
|
|
1390
1392
|
m.key === "Enter" && (t([...n, m.currentTarget.value]), d("")), (m.key === "Backspace" || m.key === "Delete") && n.length && !u && t(n.slice(0, -1));
|
|
1391
1393
|
},
|
|
1392
1394
|
[n, t, u]
|
|
1393
|
-
), f =
|
|
1395
|
+
), f = E(
|
|
1394
1396
|
(m) => {
|
|
1395
1397
|
d(m.target.value);
|
|
1396
1398
|
},
|
|
@@ -1437,26 +1439,26 @@ const Xr = {
|
|
|
1437
1439
|
disabled: u,
|
|
1438
1440
|
onChange: d
|
|
1439
1441
|
}) => {
|
|
1440
|
-
const i = de(null), [f, m] = F(e), [g, x] = F(""), [v,
|
|
1441
|
-
const w =
|
|
1442
|
+
const i = de(null), [f, m] = F(e), [g, x] = F(""), [v, C] = F(!1), k = (y) => {
|
|
1443
|
+
const w = y.trim().replace(/,$/, "");
|
|
1442
1444
|
if (w && !f.includes(w)) {
|
|
1443
|
-
const
|
|
1444
|
-
m(
|
|
1445
|
+
const P = [w, ...f];
|
|
1446
|
+
m(P), d?.(P);
|
|
1445
1447
|
}
|
|
1446
|
-
}, N = (
|
|
1447
|
-
(
|
|
1448
|
-
}, b = (
|
|
1449
|
-
const w = f.filter((
|
|
1448
|
+
}, N = (y) => {
|
|
1449
|
+
(y.key === "," || y.key === "Enter") && (y.preventDefault(), k(g), x(""));
|
|
1450
|
+
}, b = (y) => {
|
|
1451
|
+
const w = f.filter((P, O) => O !== y);
|
|
1450
1452
|
m(w), d?.(w);
|
|
1451
1453
|
};
|
|
1452
1454
|
return ee(() => {
|
|
1453
|
-
const
|
|
1455
|
+
const y = new ResizeObserver(() => {
|
|
1454
1456
|
if (i.current) {
|
|
1455
1457
|
const w = i.current.scrollHeight > i.current.clientHeight + 10;
|
|
1456
|
-
|
|
1458
|
+
C(w);
|
|
1457
1459
|
}
|
|
1458
1460
|
});
|
|
1459
|
-
return i.current &&
|
|
1461
|
+
return i.current && y.observe(i.current), () => y.disconnect();
|
|
1460
1462
|
}, [f]), /* @__PURE__ */ p("div", { className: l("flex flex-col w-full"), children: [
|
|
1461
1463
|
/* @__PURE__ */ r(
|
|
1462
1464
|
$,
|
|
@@ -1483,20 +1485,20 @@ const Xr = {
|
|
|
1483
1485
|
v ? "flex-col-reverse" : "flex-row"
|
|
1484
1486
|
),
|
|
1485
1487
|
children: [
|
|
1486
|
-
f.map((
|
|
1488
|
+
f.map((y, w) => /* @__PURE__ */ r(
|
|
1487
1489
|
Mr,
|
|
1488
1490
|
{
|
|
1489
|
-
tag:
|
|
1491
|
+
tag: y,
|
|
1490
1492
|
remove: u ? void 0 : () => b(w)
|
|
1491
1493
|
},
|
|
1492
|
-
|
|
1494
|
+
y + w
|
|
1493
1495
|
)),
|
|
1494
1496
|
/* @__PURE__ */ r(
|
|
1495
1497
|
"input",
|
|
1496
1498
|
{
|
|
1497
1499
|
type: "text",
|
|
1498
1500
|
value: g,
|
|
1499
|
-
onChange: (
|
|
1501
|
+
onChange: (y) => x(y.target.value),
|
|
1500
1502
|
onKeyDown: N,
|
|
1501
1503
|
className: l(
|
|
1502
1504
|
"dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"
|
|
@@ -1542,19 +1544,19 @@ const Qr = l(
|
|
|
1542
1544
|
outsidePressIgnoreRef: x,
|
|
1543
1545
|
outsideClosable: v = !0
|
|
1544
1546
|
}) => {
|
|
1545
|
-
const [
|
|
1547
|
+
const [C, k] = F(u), N = c !== void 0, b = N ? !!c : C, y = E(
|
|
1546
1548
|
(h) => {
|
|
1547
1549
|
N || k(h), d?.(h);
|
|
1548
1550
|
},
|
|
1549
1551
|
[N, d]
|
|
1550
|
-
), w = Ye(),
|
|
1552
|
+
), w = Ye(), P = (h) => h ? "clientWidth" in h ? h.clientWidth : h.getBoundingClientRect?.()?.width ?? 0 : 0, O = a === void 0, { refs: A, floatingStyles: S, context: D } = re({
|
|
1551
1553
|
placement: a,
|
|
1552
1554
|
open: b,
|
|
1553
|
-
onOpenChange:
|
|
1555
|
+
onOpenChange: y,
|
|
1554
1556
|
whileElementsMounted: he,
|
|
1555
1557
|
middleware: [
|
|
1556
1558
|
pe({ mainAxis: U, crossAxis: 0 }),
|
|
1557
|
-
|
|
1559
|
+
O ? tr({
|
|
1558
1560
|
alignment: "start",
|
|
1559
1561
|
crossAxis: !0,
|
|
1560
1562
|
padding: U
|
|
@@ -1562,7 +1564,7 @@ const Qr = l(
|
|
|
1562
1564
|
me({ padding: U }),
|
|
1563
1565
|
sr({
|
|
1564
1566
|
apply({ availableWidth: h, elements: T }) {
|
|
1565
|
-
const Te =
|
|
1567
|
+
const Te = P(T.reference);
|
|
1566
1568
|
T.floating.style.setProperty(
|
|
1567
1569
|
"--reference-width",
|
|
1568
1570
|
`${Te}px`
|
|
@@ -1570,14 +1572,14 @@ const Qr = l(
|
|
|
1570
1572
|
}
|
|
1571
1573
|
})
|
|
1572
1574
|
]
|
|
1573
|
-
}),
|
|
1575
|
+
}), B = ar(D, {
|
|
1574
1576
|
enabled: s.includes(G.Click) && !o
|
|
1575
|
-
}), Ie = xe(
|
|
1577
|
+
}), Ie = xe(D, {
|
|
1576
1578
|
enabled: s.includes(G.Hover) && !o,
|
|
1577
1579
|
move: !1,
|
|
1578
1580
|
restMs: 40,
|
|
1579
1581
|
delay: { open: 80, close: 80 }
|
|
1580
|
-
}), Re = ne(
|
|
1582
|
+
}), Re = ne(D, {
|
|
1581
1583
|
bubbles: !0,
|
|
1582
1584
|
referencePress: !1,
|
|
1583
1585
|
outsidePress: (h) => {
|
|
@@ -1585,19 +1587,19 @@ const Qr = l(
|
|
|
1585
1587
|
const T = h.target;
|
|
1586
1588
|
return !(x?.current && T instanceof Node && x.current.contains(T));
|
|
1587
1589
|
}
|
|
1588
|
-
}), Ee = te(
|
|
1589
|
-
|
|
1590
|
+
}), Ee = te(D, { role: "menu" }), { getReferenceProps: Se, getFloatingProps: Le } = se([
|
|
1591
|
+
B,
|
|
1590
1592
|
Ie,
|
|
1591
1593
|
Re,
|
|
1592
1594
|
Ee
|
|
1593
1595
|
]), Fe = (h) => {
|
|
1594
|
-
!s.includes(G.ContextMenu) || o || (h.preventDefault(),
|
|
1596
|
+
!s.includes(G.ContextMenu) || o || (h.preventDefault(), y(!0));
|
|
1595
1597
|
};
|
|
1596
1598
|
ee(() => {
|
|
1597
|
-
o && b &&
|
|
1598
|
-
}, [o, b,
|
|
1599
|
+
o && b && y(!1);
|
|
1600
|
+
}, [o, b, y]);
|
|
1599
1601
|
const Me = (h) => (T) => {
|
|
1600
|
-
h.disabled || (h.onClick?.({ key: h.key, domEvent: T }), n?.onClick?.({ key: h.key, domEvent: T }),
|
|
1602
|
+
h.disabled || (h.onClick?.({ key: h.key, domEvent: T }), n?.onClick?.({ key: h.key, domEvent: T }), y(!1));
|
|
1601
1603
|
}, Pe = t ? t() : n && /* @__PURE__ */ r("div", { role: "none", className: "py-1", children: n.items.map((h) => h.type === De.Divider ? /* @__PURE__ */ r(
|
|
1602
1604
|
"div",
|
|
1603
1605
|
{
|
|
@@ -1648,7 +1650,7 @@ const Qr = l(
|
|
|
1648
1650
|
/* @__PURE__ */ r(
|
|
1649
1651
|
"span",
|
|
1650
1652
|
{
|
|
1651
|
-
ref:
|
|
1653
|
+
ref: A.setReference,
|
|
1652
1654
|
className: l(
|
|
1653
1655
|
Qr,
|
|
1654
1656
|
o && "!cursor-not-allowed opacity-75",
|
|
@@ -1663,9 +1665,9 @@ const Qr = l(
|
|
|
1663
1665
|
}
|
|
1664
1666
|
),
|
|
1665
1667
|
b && /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(
|
|
1666
|
-
|
|
1668
|
+
ye,
|
|
1667
1669
|
{
|
|
1668
|
-
context:
|
|
1670
|
+
context: D,
|
|
1669
1671
|
modal: !1,
|
|
1670
1672
|
initialFocus: -1,
|
|
1671
1673
|
returnFocus: !0,
|
|
@@ -1673,8 +1675,8 @@ const Qr = l(
|
|
|
1673
1675
|
"div",
|
|
1674
1676
|
{
|
|
1675
1677
|
id: w,
|
|
1676
|
-
ref:
|
|
1677
|
-
style:
|
|
1678
|
+
ref: A.setFloating,
|
|
1679
|
+
style: S,
|
|
1678
1680
|
className: l(Yr, g),
|
|
1679
1681
|
...Le(),
|
|
1680
1682
|
children: [
|
|
@@ -1683,7 +1685,7 @@ const Qr = l(
|
|
|
1683
1685
|
{
|
|
1684
1686
|
ariaLabel: "Close dropdown",
|
|
1685
1687
|
onClose: (h) => {
|
|
1686
|
-
f?.(h),
|
|
1688
|
+
f?.(h), y(!1);
|
|
1687
1689
|
}
|
|
1688
1690
|
}
|
|
1689
1691
|
) }),
|
|
@@ -1696,8 +1698,8 @@ const Qr = l(
|
|
|
1696
1698
|
] });
|
|
1697
1699
|
};
|
|
1698
1700
|
export {
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
+
z as AlertVariant,
|
|
1702
|
+
I as ButtonVariant,
|
|
1701
1703
|
Q as ConfirmationPopupVariant,
|
|
1702
1704
|
dn as DialAlert,
|
|
1703
1705
|
kn as DialAutocompleteInput,
|
|
@@ -1725,17 +1727,17 @@ export {
|
|
|
1725
1727
|
vn as DialRadioGroupPopupField,
|
|
1726
1728
|
Nn as DialSearch,
|
|
1727
1729
|
pn as DialSteps,
|
|
1728
|
-
|
|
1730
|
+
Cn as DialSwitch,
|
|
1729
1731
|
Mr as DialTag,
|
|
1730
1732
|
Dn as DialTagInput,
|
|
1731
|
-
|
|
1733
|
+
yn as DialTextAreaField,
|
|
1732
1734
|
gn as DialTextInputField,
|
|
1733
1735
|
Pr as DialTextarea,
|
|
1734
|
-
|
|
1736
|
+
W as DialTooltip,
|
|
1735
1737
|
qr as DropdownType,
|
|
1736
|
-
|
|
1738
|
+
j as PopupSize,
|
|
1737
1739
|
X as RadioGroupOrientation,
|
|
1738
1740
|
Y as SearchSize,
|
|
1739
|
-
|
|
1741
|
+
R as StepStatus,
|
|
1740
1742
|
oe as TagVariant
|
|
1741
1743
|
};
|
|
@@ -4,7 +4,7 @@ export interface DialInputPopupProps {
|
|
|
4
4
|
selectedValue?: string | string[];
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
onOpen: () => void;
|
|
7
|
-
|
|
7
|
+
disabled?: boolean;
|
|
8
8
|
valueCssClasses?: string;
|
|
9
9
|
inputCssClasses?: string;
|
|
10
10
|
elementId?: string;
|
|
@@ -23,7 +23,7 @@ export interface DialInputPopupProps {
|
|
|
23
23
|
* selectedValue="Selected Item"
|
|
24
24
|
* emptyValueText="No value selected"
|
|
25
25
|
* onOpen={() => setModalState(true)}
|
|
26
|
-
*
|
|
26
|
+
* disabled={false}
|
|
27
27
|
* valueCssClasses="custom-value-class"
|
|
28
28
|
* inputCssClasses="custom-input-class"
|
|
29
29
|
* elementId="input-modal"
|
|
@@ -37,7 +37,7 @@ export interface DialInputPopupProps {
|
|
|
37
37
|
* @param [selectedValue] - The currently selected value(s). Can be a string for a single value or an array of strings for multiple values.
|
|
38
38
|
* @param children - The content to render inside the modal when it is opened.
|
|
39
39
|
* @param onOpen - A callback function triggered when the modal open button is clicked.
|
|
40
|
-
* @param [
|
|
40
|
+
* @param [disabled=false] - Whether the input is disabled, preventing user interaction.
|
|
41
41
|
* @param [valueCssClasses] - Additional CSS classes applied to the displayed value.
|
|
42
42
|
* @param [inputCssClasses] - Additional CSS classes applied to the input container.
|
|
43
43
|
* @param [elementId] - A unique identifier for the input element, useful for accessibility and testing.
|
|
@@ -3,7 +3,7 @@ import { DialFieldLabelProps } from '../Field/Field';
|
|
|
3
3
|
import { DialInputPopupProps } from '../InputPopup/InputPopup';
|
|
4
4
|
import { DialRadioGroupProps } from '../RadioGroup/RadioGroup';
|
|
5
5
|
import { DialPopupProps } from '../Popup/Popup';
|
|
6
|
-
export interface RadioGroupPopupFieldProps extends Pick<DialFieldLabelProps, 'fieldTitle' | 'htmlFor'>, Omit<DialInputPopupProps, 'onOpen' | 'children'>, Pick<DialRadioGroupProps, 'radioButtons'>, Pick<DialPopupProps, 'onClose' | 'portalId'> {
|
|
6
|
+
export interface RadioGroupPopupFieldProps extends Pick<DialFieldLabelProps, 'fieldTitle' | 'htmlFor'>, Omit<DialInputPopupProps, 'onOpen' | 'children'>, Pick<DialRadioGroupProps, 'radioButtons'>, Pick<DialPopupProps, 'onClose' | 'portalId' | 'size'> {
|
|
7
7
|
customInputValue?: string;
|
|
8
8
|
title: string;
|
|
9
9
|
cancelButtonTitle?: string;
|
|
@@ -64,5 +64,6 @@ export interface RadioGroupPopupFieldProps extends Pick<DialFieldLabelProps, 'fi
|
|
|
64
64
|
* @param selectedRadioValue - Currently selected radio id inside the popup
|
|
65
65
|
* @param onChangeRadioField - Handler for radio selection changes
|
|
66
66
|
* @param id - Element id used for the internal radio group
|
|
67
|
+
* @param [size=PopupSize.Md] - Size of the popup
|
|
67
68
|
*/
|
|
68
69
|
export declare const DialRadioGroupPopupField: FC<RadioGroupPopupFieldProps>;
|