@epam/ai-dial-ui-kit 0.2.0-rc.6 → 0.2.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("classnames"),D=require("@tabler/icons-react"),u=require("@floating-ui/react"),f=require("react"),N=({icon:e,className:r})=>e?s.jsx("span",{className:d("flex-shrink-0",r),children:e}):null;var T=(e=>(e.Primary="primary",e.Secondary="secondary",e.Tertiary="tertiary",e))(T||{});const O={[T.Primary]:"dial-primary-button",[T.Secondary]:"dial-secondary-button",[T.Tertiary]:"dial-tertiary-button"},z=({title:e,variant:r,cssClass:t,ref:n,onClick:l,disable:a,iconAfter:o,iconBefore:c,hideTitleOnMobile:i,ariaLabel:p})=>{const x=d("dial-small-semi",o?"mr-2":"",c?"ml-2":"",i?"hidden sm:inline":"inline"),m=d(r&&O[r],t,"focus-visible:outline outline-offset-0");return s.jsxs("button",{ref:n,type:"button",className:m,onClick:y=>l?.(y),disabled:a,"aria-label":e||p,children:[s.jsx(N,{icon:c}),e&&s.jsx("span",{className:x,children:e}),s.jsx(N,{icon:o})]})},S=({errorText:e})=>e&&s.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),P=({fieldTitle:e,htmlFor:r,optional:t,optionalText:n,cssClass:l})=>e?s.jsxs("label",{className:d("dial-tiny text-secondary",l,!l?.includes("mb")&&"mb-2"),htmlFor:r,children:[s.jsx("span",{className:"min-h-4",children:e}),t&&s.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null;var j=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(j||{});const V={info:s.jsx(D.IconInfoCircle,{size:24,stroke:2}),error:s.jsx(D.IconAlertCircle,{size:24,stroke:2}),warning:s.jsx(D.IconAlertTriangle,{size:24,stroke:2}),success:s.jsx(D.IconCircleCheck,{size:24,stroke:2})},$={[j.Info]:"bg-info border-info text-info",[j.Success]:"bg-success border-success text-success",[j.Warning]:"bg-warning border-warning text-warning",[j.Error]:"bg-error border-error text-error"},B="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",G=({variant:e=j.Info,message:r,cssClass:t,closable:n=!1,onClose:l})=>s.jsxs("div",{role:"alert",className:d(B,$[e],t),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(N,{icon:V[e]}),s.jsx("div",{className:"text-primary",children:r})]}),n&&s.jsx(z,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:s.jsx(D.IconX,{size:16}),onClick:a=>l?.(a)})]}),X=7,Y=2,M=f.createContext(null),W=()=>{const e=f.useContext(M);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Z=({initialOpen:e=!1,placement:r="bottom",isTriggerClickable:t=!1,open:n,onOpenChange:l}={})=>{const[a,o]=f.useState(e),c=f.useRef(null),i=n??a,p=l??o,x=u.useFloating({placement:r,open:i,onOpenChange:p,whileElementsMounted:u.autoUpdate,middleware:[u.offset(X+Y),u.flip({crossAxis:r.includes("-"),fallbackAxisSideDirection:"start",padding:5}),u.shift({padding:5}),u.arrow({element:c})]}),m=u.useHover(x.context,{move:!1,enabled:n==null,mouseOnly:t,delay:{open:500,close:0}}),y=u.useFocus(x.context,{enabled:n==null}),R=u.useDismiss(x.context),b=u.useRole(x.context,{role:"tooltip"}),g=u.useInteractions([m,y,R,b]);return f.useMemo(()=>({open:i,setOpen:p,arrowRef:c,...g,...x}),[i,p,g,x])},J=({children:e,...r})=>{const t=Z(r);return s.jsx(M.Provider,{value:t,children:e})},Q=f.forwardRef(function({style:r,...t},n){const l=W(),a=u.useMergeRefs([l.refs.setFloating,n]);return l.open?s.jsx(u.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:a,style:{...l.floatingStyles,...r},...l.getFloatingProps(t),className:d("z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",l.getFloatingProps(t).className),children:[t.children,s.jsx(u.FloatingArrow,{ref:l.arrowRef,context:l.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),ee=f.forwardRef(function({children:r,asChild:t=!1,...n},l){const a=W(),c=r&&typeof r=="object"&&"ref"in r&&r.ref!==void 0?r.ref:void 0,i=u.useMergeRefs([a.refs.setReference,l,c]);return t&&f.isValidElement(r)?f.cloneElement(r,a.getReferenceProps({ref:i,...n,...r.props})):s.jsx("span",{ref:i,...a.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:r})}),k=({hideTooltip:e,tooltip:r,children:t,triggerClassName:n,contentClassName:l,...a})=>e||!r?s.jsx("span",{className:n,children:t}):s.jsxs(J,{...a,children:[s.jsx(ee,{className:d(n,"truncate"),children:t}),s.jsx(Q,{className:d("text-primary",l,"max-w-[300px]",(e||!r)&&"hidden"),children:r})]}),L=({value:e,textareaId:r,placeholder:t,cssClass:n="",disabled:l,invalid:a,readonly:o,onChange:c})=>s.jsx(k,{tooltip:e,triggerClassName:"flex",children:s.jsx("textarea",{id:r,placeholder:t,value:e||"",disabled:l,className:d("dial-textarea dial-input",a?"dial-input-error":"",l&&"dial-input-disable",o&&"dial-input-readonly",n),onChange:i=>!o&&c?.(i.currentTarget.value)})}),se=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],re=(e,r,t,n)=>{if((r==="number"||t!==void 0||n!==void 0)&&!se.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(t===void 0||t<0))&&!(e.key==="."&&r==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(t!==void 0||n!==void 0){const a=e.currentTarget.value,o=e.currentTarget.selectionStart||0,c=a.slice(0,o)+e.key+a.slice(o),i=parseFloat(c);if(!isNaN(i)){if(t!==void 0&&i<t){e.preventDefault();return}if(n!==void 0&&i>n){e.preventDefault();return}}}}},I=({iconBeforeInput:e,iconAfterInput:r,hideBorder:t,value:n,elementId:l,placeholder:a="",cssClass:o="",containerCssClass:c,tooltipTriggerClassName:i,type:p="text",disabled:x,readonly:m,invalid:y,onChange:R,min:b,max:g,prefix:E,suffix:A,textBeforeInput:v,textAfterInput:C})=>{const H=h=>h.target.blur(),U=p==="number"||b!==void 0||g!==void 0,_=h=>{re(h,p,b,g)},K=h=>{const w=h.currentTarget.value;if(U&&w!==""){const F=parseFloat(w);if(isNaN(F)&&w!=="-"&&w!=="."||!isNaN(F)&&(b!==void 0&&F<b||g!==void 0&&F>g))return}R?.(w)};return s.jsxs("div",{className:d("dial-input-field flex flex-row items-center justify-between",t?"dial-input-no-border":"dial-input",y&&"dial-input-error",x&&"dial-input-disable",m&&"dial-input-readonly",!v&&"pl-1",!C&&"pr-1",c),children:[v&&s.jsx(k,{tooltip:v,children:s.jsx(I,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"px-2 overflow-hidden overflow-ellipsis dial-small",value:v,disabled:!0,elementId:v+"textBefore"})}),E&&s.jsxs("p",{className:"text-secondary dial-small pl-2",children:[" ",E]}),s.jsx(N,{icon:e,className:"pl-2"}),s.jsx(k,{tooltip:n,triggerClassName:i,children:s.jsx("input",{type:p,autoComplete:"off",id:l,placeholder:a,value:n??"",title:n?String(n):"",disabled:x,className:d("border-0 bg-transparent px-2",o),onChange:h=>!m&&K?.(h),onKeyDown:_,onWheel:H,min:b,max:g})}),s.jsx(N,{icon:r,className:"pr-2"}),A&&s.jsxs("p",{className:"text-secondary dial-small pr-2",children:[" ",A]}),C&&s.jsx(k,{tooltip:C,children:s.jsx(I,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",cssClass:"px-2",value:C,disabled:!0,elementId:C+"textAfter"})})]})},te=/^0+\.(\d+)?$/,ne=/^0+/,q=({fieldTitle:e,errorText:r,optional:t,elementCssClass:n,elementContainerCssClass:l,elementId:a,containerCssClass:o,readonly:c,defaultEmptyText:i,min:p,max:x,...m})=>s.jsxs("div",{className:d("flex flex-col",o),children:[s.jsx(P,{fieldTitle:e,optional:t,htmlFor:a}),c?s.jsx("span",{children:m.value||(i??"None")}):s.jsxs(s.Fragment,{children:[s.jsx(I,{elementId:a,cssClass:n,containerCssClass:l,invalid:r!=null,min:p,max:x,...m}),s.jsx(S,{errorText:r})]})]}),le=({onChange:e,value:r,min:t,max:n,...l})=>{const a=o=>String(o)?.match(te)?String(o)?.replace(ne,"0"):Number(o);return s.jsx(q,{type:"number",onChange:o=>e?.(a(o)),value:r,min:t,max:n,...l})},ae=({onChange:e,...r})=>s.jsx(q,{type:"text",onChange:t=>e?.(t),...r}),oe=({fieldTitle:e,optional:r,elementId:t,elementCssClass:n,errorText:l,...a})=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(P,{fieldTitle:e,optional:r,htmlFor:t}),s.jsx(L,{textareaId:t,cssClass:n,...a}),s.jsx(S,{errorText:l})]}),ie=({title:e,switchId:r,isOn:t=!1,disabled:n,onChange:l})=>{const a=d("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",t?"flex-row-reverse":"flex-row",n?"pointer-events-none":"",n?t?"bg-controls-disable":"bg-layer-4":t?"bg-accent-primary":"bg-layer-4"),o=f.useCallback(c=>{c.stopPropagation(),l?.(!t)},[l,t]);return s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx("input",{type:"checkbox",onChange:o,id:r,disabled:n,className:"invisible w-0 h-0",checked:t}),s.jsx("label",{htmlFor:r,className:a,children:s.jsx("span",{className:d("size-3 rounded-full",n?t?"bg-controls-disable":"bg-layer-4":"bg-controls-enable-primary")})}),e&&s.jsx("span",{className:"h-[14px] pl-2 small text-primary",children:e})]})};exports.AlertVariant=j;exports.ButtonVariant=T;exports.DialAlert=G;exports.DialButton=z;exports.DialErrorText=S;exports.DialFieldLabel=P;exports.DialIcon=N;exports.DialInput=I;exports.DialNumberInputField=le;exports.DialSwitch=ie;exports.DialTextAreaField=oe;exports.DialTextInputField=ae;exports.DialTextarea=L;exports.DialTooltip=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("classnames"),y=require("@tabler/icons-react"),d=require("@floating-ui/react"),f=require("react"),N=({icon:e,className:r})=>e?s.jsx("span",{className:u("flex-shrink-0",r),children:e}):null;var T=(e=>(e.Primary="primary",e.Secondary="secondary",e.Tertiary="tertiary",e))(T||{});const K={[T.Primary]:"dial-primary-button",[T.Secondary]:"dial-secondary-button",[T.Tertiary]:"dial-tertiary-button"},L=({title:e,variant:r,cssClass:t,ref:n,onClick:a,disable:l,iconAfter:o,iconBefore:c,hideTitleOnMobile:i,ariaLabel:p})=>{const x=u("dial-small-semi",o?"mr-2":"",c?"ml-2":"",i?"hidden sm:inline":"inline"),m=u(r&&K[r],t,"focus-visible:outline outline-offset-0");return s.jsxs("button",{ref:n,type:"button",className:m,onClick:v=>a?.(v),disabled:l,"aria-label":e||p,children:[s.jsx(N,{icon:c}),e&&s.jsx("span",{className:x,children:e}),s.jsx(N,{icon:o})]})},S=({errorText:e})=>e&&s.jsx("span",{className:"text-error dial-tiny mt-1",children:e}),P=({fieldTitle:e,htmlFor:r,optional:t,optionalText:n,cssClass:a})=>e?s.jsxs("label",{className:u("dial-tiny text-secondary",a,!a?.includes("mb")&&"mb-2"),htmlFor:r,children:[s.jsx("span",{className:"min-h-4",children:e}),t&&s.jsx("span",{className:"ml-1",children:n??"(Optional)"})]}):null;var j=(e=>(e.Info="info",e.Success="success",e.Warning="warning",e.Error="error",e))(j||{});const O={info:s.jsx(y.IconInfoCircle,{size:24,stroke:2}),error:s.jsx(y.IconAlertCircle,{size:24,stroke:2}),warning:s.jsx(y.IconAlertTriangle,{size:24,stroke:2}),success:s.jsx(y.IconCircleCheck,{size:24,stroke:2})},V={[j.Info]:"bg-info border-info text-info",[j.Success]:"bg-success border-success text-success",[j.Warning]:"bg-warning border-warning text-warning",[j.Error]:"bg-error border-error text-error"},$="items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex",G=({variant:e=j.Info,message:r,cssClass:t,closable:n=!1,onClose:a})=>s.jsxs("div",{role:"alert",className:u($,V[e],t),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(N,{icon:O[e]}),s.jsx("div",{className:"text-primary",children:r})]}),n&&s.jsx(L,{cssClass:"ml-2 text-secondary hover:text-primary",ariaLabel:"Close alert",iconBefore:s.jsx(y.IconX,{size:16}),onClick:l=>a?.(l)})]}),X="flex items-center justify-center text-secondary",Y="shrink-0 grow-0 basis-auto animate-spin-steps",Z=({size:e=18,cssClass:r,iconClass:t,fullWidth:n=!0,ariaLabel:a="Loading"})=>s.jsx("div",{role:"status","aria-label":a,className:u({[X]:!0,"w-full h-full":n,[r||""]:!!r}),children:s.jsx(N,{icon:s.jsx(y.IconLoader,{width:e,height:e,className:u(Y,t)})})}),J=7,Q=2,M=f.createContext(null),W=()=>{const e=f.useContext(M);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},ee=({initialOpen:e=!1,placement:r="bottom",isTriggerClickable:t=!1,open:n,onOpenChange:a}={})=>{const[l,o]=f.useState(e),c=f.useRef(null),i=n??l,p=a??o,x=d.useFloating({placement:r,open:i,onOpenChange:p,whileElementsMounted:d.autoUpdate,middleware:[d.offset(J+Q),d.flip({crossAxis:r.includes("-"),fallbackAxisSideDirection:"start",padding:5}),d.shift({padding:5}),d.arrow({element:c})]}),m=d.useHover(x.context,{move:!1,enabled:n==null,mouseOnly:t,delay:{open:500,close:0}}),v=d.useFocus(x.context,{enabled:n==null}),R=d.useDismiss(x.context),b=d.useRole(x.context,{role:"tooltip"}),g=d.useInteractions([m,v,R,b]);return f.useMemo(()=>({open:i,setOpen:p,arrowRef:c,...g,...x}),[i,p,g,x])},se=({children:e,...r})=>{const t=ee(r);return s.jsx(M.Provider,{value:t,children:e})},re=f.forwardRef(function({style:r,...t},n){const a=W(),l=d.useMergeRefs([a.refs.setFloating,n]);return a.open?s.jsx(d.FloatingPortal,{id:"tooltip-portal",children:s.jsxs("div",{ref:l,style:{...a.floatingStyles,...r},...a.getFloatingProps(t),className:u("z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",a.getFloatingProps(t).className),children:[t.children,s.jsx(d.FloatingArrow,{ref:a.arrowRef,context:a.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary w-2 text-[var(--bg-layer-0,_#000000)]"})]})}):null}),te=f.forwardRef(function({children:r,asChild:t=!1,...n},a){const l=W(),c=r&&typeof r=="object"&&"ref"in r&&r.ref!==void 0?r.ref:void 0,i=d.useMergeRefs([l.refs.setReference,a,c]);return t&&f.isValidElement(r)?f.cloneElement(r,l.getReferenceProps({ref:i,...n,...r.props})):s.jsx("span",{ref:i,...l.getReferenceProps(n),className:n.className??"dial-tooltip-trigger text-left",children:r})}),k=({hideTooltip:e,tooltip:r,children:t,triggerClassName:n,contentClassName:a,...l})=>e||!r?s.jsx("span",{className:n,children:t}):s.jsxs(se,{...l,children:[s.jsx(te,{className:u(n,"truncate"),children:t}),s.jsx(re,{className:u("text-primary",a,"max-w-[300px]",(e||!r)&&"hidden"),children:r})]}),z=({value:e,textareaId:r,placeholder:t,cssClass:n="",disabled:a,invalid:l,readonly:o,onChange:c})=>s.jsx(k,{tooltip:e,triggerClassName:"flex",children:s.jsx("textarea",{id:r,placeholder:t,value:e||"",disabled:a,className:u("dial-textarea dial-input",l?"dial-input-error":"",a&&"dial-input-disable",o&&"dial-input-readonly",n),onChange:i=>!o&&c?.(i.currentTarget.value)})}),ne=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End"],ae=(e,r,t,n)=>{if((r==="number"||t!==void 0||n!==void 0)&&!ne.includes(e.key)&&!(e.key==="-"&&e.currentTarget.selectionStart===0&&(t===void 0||t<0))&&!(e.key==="."&&r==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(t!==void 0||n!==void 0){const l=e.currentTarget.value,o=e.currentTarget.selectionStart||0,c=l.slice(0,o)+e.key+l.slice(o),i=parseFloat(c);if(!isNaN(i)){if(t!==void 0&&i<t){e.preventDefault();return}if(n!==void 0&&i>n){e.preventDefault();return}}}}},I=({iconBeforeInput:e,iconAfterInput:r,hideBorder:t,value:n,elementId:a,placeholder:l="",cssClass:o="",containerCssClass:c,tooltipTriggerClassName:i,type:p="text",disabled:x,readonly:m,invalid:v,onChange:R,min:b,max:g,prefix:E,suffix:A,textBeforeInput:w,textAfterInput:C})=>{const B=h=>h.target.blur(),H=p==="number"||b!==void 0||g!==void 0,U=h=>{ae(h,p,b,g)},_=h=>{const D=h.currentTarget.value;if(H&&D!==""){const F=parseFloat(D);if(isNaN(F)&&D!=="-"&&D!=="."||!isNaN(F)&&(b!==void 0&&F<b||g!==void 0&&F>g))return}R?.(D)};return s.jsxs("div",{className:u("dial-input-field flex flex-row items-center justify-between",t?"dial-input-no-border":"dial-input",v&&"dial-input-error",x&&"dial-input-disable",m&&"dial-input-readonly",!w&&"pl-1",!C&&"pr-1",c),children:[w&&s.jsx(k,{tooltip:w,children:s.jsx(I,{hideBorder:!0,containerCssClass:"rounded-r-none border-r-0",cssClass:"px-2 overflow-hidden overflow-ellipsis dial-small",value:w,disabled:!0,elementId:w+"textBefore"})}),E&&s.jsxs("p",{className:"text-secondary dial-small pl-2",children:[" ",E]}),s.jsx(N,{icon:e,className:"pl-2"}),s.jsx(k,{tooltip:n,triggerClassName:i,children:s.jsx("input",{type:p,autoComplete:"off",id:a,placeholder:l,value:n??"",title:n?String(n):"",disabled:x,className:u("border-0 bg-transparent px-2",o),onChange:h=>!m&&_?.(h),onKeyDown:U,onWheel:B,min:b,max:g})}),s.jsx(N,{icon:r,className:"pr-2"}),A&&s.jsxs("p",{className:"text-secondary dial-small pr-2",children:[" ",A]}),C&&s.jsx(k,{tooltip:C,children:s.jsx(I,{hideBorder:!0,containerCssClass:"rounded-l-none border-l-0",cssClass:"px-2",value:C,disabled:!0,elementId:C+"textAfter"})})]})},le=/^0+\.(\d+)?$/,oe=/^0+/,q=({fieldTitle:e,errorText:r,optional:t,elementCssClass:n,elementContainerCssClass:a,elementId:l,containerCssClass:o,readonly:c,defaultEmptyText:i,min:p,max:x,...m})=>s.jsxs("div",{className:u("flex flex-col",o),children:[s.jsx(P,{fieldTitle:e,optional:t,htmlFor:l}),c?s.jsx("span",{children:m.value||(i??"None")}):s.jsxs(s.Fragment,{children:[s.jsx(I,{elementId:l,cssClass:n,containerCssClass:a,invalid:r!=null,min:p,max:x,...m}),s.jsx(S,{errorText:r})]})]}),ie=({onChange:e,value:r,min:t,max:n,...a})=>{const l=o=>String(o)?.match(le)?String(o)?.replace(oe,"0"):Number(o);return s.jsx(q,{type:"number",onChange:o=>e?.(l(o)),value:r,min:t,max:n,...a})},ce=({onChange:e,...r})=>s.jsx(q,{type:"text",onChange:t=>e?.(t),...r}),ue=({fieldTitle:e,optional:r,elementId:t,elementCssClass:n,errorText:a,...l})=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx(P,{fieldTitle:e,optional:r,htmlFor:t}),s.jsx(z,{textareaId:t,cssClass:n,...l}),s.jsx(S,{errorText:a})]}),de=({title:e,switchId:r,isOn:t=!1,disabled:n,onChange:a})=>{const l=u("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",t?"flex-row-reverse":"flex-row",n?"pointer-events-none":"",n?t?"bg-controls-disable":"bg-layer-4":t?"bg-accent-primary":"bg-layer-4"),o=f.useCallback(c=>{c.stopPropagation(),a?.(!t)},[a,t]);return s.jsxs("div",{className:"flex flex-row items-center",children:[s.jsx("input",{type:"checkbox",onChange:o,id:r,disabled:n,className:"invisible w-0 h-0",checked:t}),s.jsx("label",{htmlFor:r,className:l,children:s.jsx("span",{className:u("size-3 rounded-full",n?t?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&s.jsx("span",{className:"pl-2 dial-small text-primary",children:e})]})};exports.AlertVariant=j;exports.ButtonVariant=T;exports.DialAlert=G;exports.DialButton=L;exports.DialErrorText=S;exports.DialFieldLabel=P;exports.DialIcon=N;exports.DialInput=I;exports.DialLoader=Z;exports.DialNumberInputField=ie;exports.DialSwitch=de;exports.DialTextAreaField=ue;exports.DialTextInputField=ce;exports.DialTextarea=z;exports.DialTooltip=k;
@@ -1,34 +1,34 @@
1
- import { jsx as t, jsxs as p, Fragment as K } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as p, Fragment as K } from "react/jsx-runtime";
2
2
  import d from "classnames";
3
- import { IconCircleCheck as G, IconAlertTriangle as O, IconAlertCircle as $, IconInfoCircle as V, IconX as X } from "@tabler/icons-react";
4
- import { useFloating as Y, offset as Z, flip as q, shift as B, arrow as J, autoUpdate as Q, useHover as ee, useFocus as re, useDismiss as ne, useRole as te, useInteractions as se, useMergeRefs as S, FloatingPortal as oe, FloatingArrow as le } from "@floating-ui/react";
5
- import { createContext as ae, useState as ie, useRef as ce, useMemo as de, useContext as ue, forwardRef as E, isValidElement as pe, cloneElement as me, useCallback as fe } from "react";
6
- const w = ({ icon: e, className: r }) => e ? /* @__PURE__ */ t("span", { className: d("flex-shrink-0", r), children: e }) : null;
7
- var D = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e))(D || {});
8
- const ge = {
9
- [D.Primary]: "dial-primary-button",
10
- [D.Secondary]: "dial-secondary-button",
11
- [D.Tertiary]: "dial-tertiary-button"
3
+ import { IconCircleCheck as B, IconAlertTriangle as G, IconAlertCircle as O, IconInfoCircle as $, IconX as V, IconLoader as X } from "@tabler/icons-react";
4
+ import { useFloating as Y, offset as Z, flip as q, shift as J, arrow as Q, autoUpdate as ee, useHover as re, useFocus as te, useDismiss as ne, useRole as se, useInteractions as oe, useMergeRefs as S, FloatingPortal as ae, FloatingArrow as le } from "@floating-ui/react";
5
+ import { createContext as ie, useState as ce, useRef as de, useMemo as ue, useContext as pe, forwardRef as E, isValidElement as me, cloneElement as fe, useCallback as ge } from "react";
6
+ const N = ({ icon: e, className: r }) => e ? /* @__PURE__ */ n("span", { className: d("flex-shrink-0", r), children: e }) : null;
7
+ var T = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e.Tertiary = "tertiary", e))(T || {});
8
+ const he = {
9
+ [T.Primary]: "dial-primary-button",
10
+ [T.Secondary]: "dial-secondary-button",
11
+ [T.Tertiary]: "dial-tertiary-button"
12
12
  }, be = ({
13
13
  title: e,
14
14
  variant: r,
15
- cssClass: n,
15
+ cssClass: t,
16
16
  ref: s,
17
17
  onClick: o,
18
- disable: l,
19
- iconAfter: a,
18
+ disable: a,
19
+ iconAfter: l,
20
20
  iconBefore: c,
21
21
  hideTitleOnMobile: i,
22
22
  ariaLabel: m
23
23
  }) => {
24
24
  const u = d(
25
25
  "dial-small-semi",
26
- a ? "mr-2" : "",
26
+ l ? "mr-2" : "",
27
27
  c ? "ml-2" : "",
28
28
  i ? "hidden sm:inline" : "inline"
29
29
  ), f = d(
30
- r && ge[r],
31
- n,
30
+ r && he[r],
31
+ t,
32
32
  "focus-visible:outline outline-offset-0"
33
33
  );
34
34
  return /* @__PURE__ */ p(
@@ -37,20 +37,20 @@ const ge = {
37
37
  ref: s,
38
38
  type: "button",
39
39
  className: f,
40
- onClick: (N) => o?.(N),
41
- disabled: l,
40
+ onClick: (y) => o?.(y),
41
+ disabled: a,
42
42
  "aria-label": e || m,
43
43
  children: [
44
- /* @__PURE__ */ t(w, { icon: c }),
45
- e && /* @__PURE__ */ t("span", { className: u, children: e }),
46
- /* @__PURE__ */ t(w, { icon: a })
44
+ /* @__PURE__ */ n(N, { icon: c }),
45
+ e && /* @__PURE__ */ n("span", { className: u, children: e }),
46
+ /* @__PURE__ */ n(N, { icon: l })
47
47
  ]
48
48
  }
49
49
  );
50
- }, z = ({ errorText: e }) => e && /* @__PURE__ */ t("span", { className: "text-error dial-tiny mt-1", children: e }), A = ({
50
+ }, L = ({ errorText: e }) => e && /* @__PURE__ */ n("span", { className: "text-error dial-tiny mt-1", children: e }), A = ({
51
51
  fieldTitle: e,
52
52
  htmlFor: r,
53
- optional: n,
53
+ optional: t,
54
54
  optionalText: s,
55
55
  cssClass: o
56
56
  }) => e ? /* @__PURE__ */ p(
@@ -63,26 +63,26 @@ const ge = {
63
63
  ),
64
64
  htmlFor: r,
65
65
  children: [
66
- /* @__PURE__ */ t("span", { className: "min-h-4", children: e }),
67
- n && /* @__PURE__ */ t("span", { className: "ml-1", children: s ?? "(Optional)" })
66
+ /* @__PURE__ */ n("span", { className: "min-h-4", children: e }),
67
+ t && /* @__PURE__ */ n("span", { className: "ml-1", children: s ?? "(Optional)" })
68
68
  ]
69
69
  }
70
70
  ) : null;
71
71
  var x = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e))(x || {});
72
- const he = {
73
- info: /* @__PURE__ */ t(V, { size: 24, stroke: 2 }),
74
- error: /* @__PURE__ */ t($, { size: 24, stroke: 2 }),
75
- warning: /* @__PURE__ */ t(O, { size: 24, stroke: 2 }),
76
- success: /* @__PURE__ */ t(G, { size: 24, stroke: 2 })
77
- }, xe = {
72
+ const xe = {
73
+ info: /* @__PURE__ */ n($, { size: 24, stroke: 2 }),
74
+ error: /* @__PURE__ */ n(O, { size: 24, stroke: 2 }),
75
+ warning: /* @__PURE__ */ n(G, { size: 24, stroke: 2 }),
76
+ success: /* @__PURE__ */ n(B, { size: 24, stroke: 2 })
77
+ }, Ne = {
78
78
  [x.Info]: "bg-info border-info text-info",
79
79
  [x.Success]: "bg-success border-success text-success",
80
80
  [x.Warning]: "bg-warning border-warning text-warning",
81
81
  [x.Error]: "bg-error border-error text-error"
82
- }, Ne = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", je = ({
82
+ }, ye = "items-center justify-between gap-2 p-3 border border-solid dial-small-150 rounded flex", He = ({
83
83
  variant: e = x.Info,
84
84
  message: r,
85
- cssClass: n,
85
+ cssClass: t,
86
86
  closable: s = !1,
87
87
  onClose: o
88
88
  }) => /* @__PURE__ */ p(
@@ -90,64 +90,94 @@ const he = {
90
90
  {
91
91
  role: "alert",
92
92
  className: d(
93
- Ne,
94
- xe[e],
95
- n
93
+ ye,
94
+ Ne[e],
95
+ t
96
96
  ),
97
97
  children: [
98
98
  /* @__PURE__ */ p("div", { className: "flex items-center gap-2", children: [
99
- /* @__PURE__ */ t(w, { icon: he[e] }),
100
- /* @__PURE__ */ t("div", { className: "text-primary", children: r })
99
+ /* @__PURE__ */ n(N, { icon: xe[e] }),
100
+ /* @__PURE__ */ n("div", { className: "text-primary", children: r })
101
101
  ] }),
102
- s && /* @__PURE__ */ t(
102
+ s && /* @__PURE__ */ n(
103
103
  be,
104
104
  {
105
105
  cssClass: "ml-2 text-secondary hover:text-primary",
106
106
  ariaLabel: "Close alert",
107
- iconBefore: /* @__PURE__ */ t(X, { size: 16 }),
108
- onClick: (l) => o?.(l)
107
+ iconBefore: /* @__PURE__ */ n(V, { size: 16 }),
108
+ onClick: (a) => o?.(a)
109
109
  }
110
110
  )
111
111
  ]
112
112
  }
113
- ), ye = 7, ve = 2, W = ae(null), j = () => {
114
- const e = ue(W);
113
+ ), ve = "flex items-center justify-center text-secondary", Ce = "shrink-0 grow-0 basis-auto animate-spin-steps", Ue = ({
114
+ size: e = 18,
115
+ cssClass: r,
116
+ iconClass: t,
117
+ fullWidth: s = !0,
118
+ ariaLabel: o = "Loading"
119
+ }) => /* @__PURE__ */ n(
120
+ "div",
121
+ {
122
+ role: "status",
123
+ "aria-label": o,
124
+ className: d({
125
+ [ve]: !0,
126
+ "w-full h-full": s,
127
+ [r || ""]: !!r
128
+ }),
129
+ children: /* @__PURE__ */ n(
130
+ N,
131
+ {
132
+ icon: /* @__PURE__ */ n(
133
+ X,
134
+ {
135
+ width: e,
136
+ height: e,
137
+ className: d(Ce, t)
138
+ }
139
+ )
140
+ }
141
+ )
142
+ }
143
+ ), we = 7, De = 2, W = ie(null), j = () => {
144
+ const e = pe(W);
115
145
  if (e == null)
116
146
  throw new Error("Tooltip components must be wrapped in <Tooltip />");
117
147
  return e;
118
- }, Ce = ({
148
+ }, Te = ({
119
149
  initialOpen: e = !1,
120
150
  placement: r = "bottom",
121
- isTriggerClickable: n = !1,
151
+ isTriggerClickable: t = !1,
122
152
  open: s,
123
153
  onOpenChange: o
124
154
  } = {}) => {
125
- const [l, a] = ie(e), c = ce(null), i = s ?? l, m = o ?? a, u = Y({
155
+ const [a, l] = ce(e), c = de(null), i = s ?? a, m = o ?? l, u = Y({
126
156
  placement: r,
127
157
  open: i,
128
158
  onOpenChange: m,
129
- whileElementsMounted: Q,
159
+ whileElementsMounted: ee,
130
160
  middleware: [
131
- Z(ye + ve),
161
+ Z(we + De),
132
162
  q({
133
163
  crossAxis: r.includes("-"),
134
164
  fallbackAxisSideDirection: "start",
135
165
  padding: 5
136
166
  }),
137
- B({ padding: 5 }),
138
- J({
167
+ J({ padding: 5 }),
168
+ Q({
139
169
  element: c
140
170
  })
141
171
  ]
142
- }), f = ee(u.context, {
172
+ }), f = re(u.context, {
143
173
  move: !1,
144
174
  enabled: s == null,
145
- mouseOnly: n,
175
+ mouseOnly: t,
146
176
  delay: { open: 500, close: 0 }
147
- }), N = re(u.context, {
177
+ }), y = te(u.context, {
148
178
  enabled: s == null
149
- }), F = ne(u.context), b = te(u.context, { role: "tooltip" }), g = se([f, N, F, b]);
150
- return de(
179
+ }), F = ne(u.context), h = se(u.context, { role: "tooltip" }), g = oe([f, y, F, h]);
180
+ return ue(
151
181
  () => ({
152
182
  open: i,
153
183
  setOpen: m,
@@ -157,30 +187,30 @@ const he = {
157
187
  }),
158
188
  [i, m, g, u]
159
189
  );
160
- }, we = ({
190
+ }, ke = ({
161
191
  children: e,
162
192
  ...r
163
193
  }) => {
164
- const n = Ce(r);
165
- return /* @__PURE__ */ t(W.Provider, { value: n, children: e });
166
- }, Te = E(function({ style: r, ...n }, s) {
167
- const o = j(), l = S([o.refs.setFloating, s]);
168
- return o.open ? /* @__PURE__ */ t(oe, { id: "tooltip-portal", children: /* @__PURE__ */ p(
194
+ const t = Te(r);
195
+ return /* @__PURE__ */ n(W.Provider, { value: t, children: e });
196
+ }, Fe = E(function({ style: r, ...t }, s) {
197
+ const o = j(), a = S([o.refs.setFloating, s]);
198
+ return o.open ? /* @__PURE__ */ n(ae, { id: "tooltip-portal", children: /* @__PURE__ */ p(
169
199
  "div",
170
200
  {
171
- ref: l,
201
+ ref: a,
172
202
  style: {
173
203
  ...o.floatingStyles,
174
204
  ...r
175
205
  },
176
- ...o.getFloatingProps(n),
206
+ ...o.getFloatingProps(t),
177
207
  className: d(
178
208
  "z-[55] whitespace-pre-wrap rounded border border-primary bg-blackout px-2 py-1 dial-tiny shadow max-w-[300px]",
179
- o.getFloatingProps(n).className
209
+ o.getFloatingProps(t).className
180
210
  ),
181
211
  children: [
182
- n.children,
183
- /* @__PURE__ */ t(
212
+ t.children,
213
+ /* @__PURE__ */ n(
184
214
  le,
185
215
  {
186
216
  ref: o.arrowRef,
@@ -193,20 +223,20 @@ const he = {
193
223
  ]
194
224
  }
195
225
  ) }) : null;
196
- }), De = E(function({ children: r, asChild: n = !1, ...s }, o) {
197
- const l = j(), c = r && typeof r == "object" && "ref" in r && r.ref !== void 0 ? r.ref : void 0, i = S([l.refs.setReference, o, c]);
198
- return n && pe(r) ? me(
226
+ }), Ie = E(function({ children: r, asChild: t = !1, ...s }, o) {
227
+ const a = j(), c = r && typeof r == "object" && "ref" in r && r.ref !== void 0 ? r.ref : void 0, i = S([a.refs.setReference, o, c]);
228
+ return t && me(r) ? fe(
199
229
  r,
200
- l.getReferenceProps({
230
+ a.getReferenceProps({
201
231
  ref: i,
202
232
  ...s,
203
233
  ...r.props
204
234
  })
205
- ) : /* @__PURE__ */ t(
235
+ ) : /* @__PURE__ */ n(
206
236
  "span",
207
237
  {
208
238
  ref: i,
209
- ...l.getReferenceProps(s),
239
+ ...a.getReferenceProps(s),
210
240
  className: s.className ?? "dial-tooltip-trigger text-left",
211
241
  children: r
212
242
  }
@@ -214,14 +244,14 @@ const he = {
214
244
  }), k = ({
215
245
  hideTooltip: e,
216
246
  tooltip: r,
217
- children: n,
247
+ children: t,
218
248
  triggerClassName: s,
219
249
  contentClassName: o,
220
- ...l
221
- }) => e || !r ? /* @__PURE__ */ t("span", { className: s, children: n }) : /* @__PURE__ */ p(we, { ...l, children: [
222
- /* @__PURE__ */ t(De, { className: d(s, "truncate"), children: n }),
223
- /* @__PURE__ */ t(
224
- Te,
250
+ ...a
251
+ }) => e || !r ? /* @__PURE__ */ n("span", { className: s, children: t }) : /* @__PURE__ */ p(ke, { ...a, children: [
252
+ /* @__PURE__ */ n(Ie, { className: d(s, "truncate"), children: t }),
253
+ /* @__PURE__ */ n(
254
+ Fe,
225
255
  {
226
256
  className: d(
227
257
  "text-primary",
@@ -232,32 +262,32 @@ const he = {
232
262
  children: r
233
263
  }
234
264
  )
235
- ] }), ke = ({
265
+ ] }), Re = ({
236
266
  value: e,
237
267
  textareaId: r,
238
- placeholder: n,
268
+ placeholder: t,
239
269
  cssClass: s = "",
240
270
  disabled: o,
241
- invalid: l,
242
- readonly: a,
271
+ invalid: a,
272
+ readonly: l,
243
273
  onChange: c
244
- }) => /* @__PURE__ */ t(k, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ t(
274
+ }) => /* @__PURE__ */ n(k, { tooltip: e, triggerClassName: "flex", children: /* @__PURE__ */ n(
245
275
  "textarea",
246
276
  {
247
277
  id: r,
248
- placeholder: n,
278
+ placeholder: t,
249
279
  value: e || "",
250
280
  disabled: o,
251
281
  className: d(
252
282
  "dial-textarea dial-input",
253
- l ? "dial-input-error" : "",
283
+ a ? "dial-input-error" : "",
254
284
  o && "dial-input-disable",
255
- a && "dial-input-readonly",
285
+ l && "dial-input-readonly",
256
286
  s
257
287
  ),
258
- onChange: (i) => !a && c?.(i.currentTarget.value)
288
+ onChange: (i) => !l && c?.(i.currentTarget.value)
259
289
  }
260
- ) }), Fe = [
290
+ ) }), Pe = [
261
291
  "ArrowLeft",
262
292
  "ArrowRight",
263
293
  "ArrowUp",
@@ -269,16 +299,16 @@ const he = {
269
299
  "Escape",
270
300
  "Home",
271
301
  "End"
272
- ], Ie = (e, r, n, s) => {
273
- if ((r === "number" || n !== void 0 || s !== void 0) && !Fe.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (n === void 0 || n < 0)) && !(e.key === "." && r === "number" && !e.currentTarget.value.includes("."))) {
302
+ ], Se = (e, r, t, s) => {
303
+ if ((r === "number" || t !== void 0 || s !== void 0) && !Pe.includes(e.key) && !(e.key === "-" && e.currentTarget.selectionStart === 0 && (t === void 0 || t < 0)) && !(e.key === "." && r === "number" && !e.currentTarget.value.includes("."))) {
274
304
  if (!/^[0-9]$/.test(e.key)) {
275
305
  e.preventDefault();
276
306
  return;
277
307
  }
278
- if (n !== void 0 || s !== void 0) {
279
- const l = e.currentTarget.value, a = e.currentTarget.selectionStart || 0, c = l.slice(0, a) + e.key + l.slice(a), i = parseFloat(c);
308
+ if (t !== void 0 || s !== void 0) {
309
+ const a = e.currentTarget.value, l = e.currentTarget.selectionStart || 0, c = a.slice(0, l) + e.key + a.slice(l), i = parseFloat(c);
280
310
  if (!isNaN(i)) {
281
- if (n !== void 0 && i < n) {
311
+ if (t !== void 0 && i < t) {
282
312
  e.preventDefault();
283
313
  return;
284
314
  }
@@ -292,130 +322,130 @@ const he = {
292
322
  }, I = ({
293
323
  iconBeforeInput: e,
294
324
  iconAfterInput: r,
295
- hideBorder: n,
325
+ hideBorder: t,
296
326
  value: s,
297
327
  elementId: o,
298
- placeholder: l = "",
299
- cssClass: a = "",
328
+ placeholder: a = "",
329
+ cssClass: l = "",
300
330
  containerCssClass: c,
301
331
  tooltipTriggerClassName: i,
302
332
  type: m = "text",
303
333
  disabled: u,
304
334
  readonly: f,
305
- invalid: N,
335
+ invalid: y,
306
336
  onChange: F,
307
- min: b,
337
+ min: h,
308
338
  max: g,
309
339
  prefix: R,
310
340
  suffix: P,
311
- textBeforeInput: y,
312
- textAfterInput: v
341
+ textBeforeInput: v,
342
+ textAfterInput: C
313
343
  }) => {
314
- const M = (h) => h.target.blur(), H = m === "number" || b !== void 0 || g !== void 0, U = (h) => {
315
- Ie(h, m, b, g);
316
- }, _ = (h) => {
317
- const C = h.currentTarget.value;
318
- if (H && C !== "") {
319
- const T = parseFloat(C);
320
- if (isNaN(T) && C !== "-" && C !== "." || !isNaN(T) && (b !== void 0 && T < b || g !== void 0 && T > g))
344
+ const M = (b) => b.target.blur(), H = m === "number" || h !== void 0 || g !== void 0, U = (b) => {
345
+ Se(b, m, h, g);
346
+ }, _ = (b) => {
347
+ const w = b.currentTarget.value;
348
+ if (H && w !== "") {
349
+ const D = parseFloat(w);
350
+ if (isNaN(D) && w !== "-" && w !== "." || !isNaN(D) && (h !== void 0 && D < h || g !== void 0 && D > g))
321
351
  return;
322
352
  }
323
- F?.(C);
353
+ F?.(w);
324
354
  };
325
355
  return /* @__PURE__ */ p(
326
356
  "div",
327
357
  {
328
358
  className: d(
329
359
  "dial-input-field flex flex-row items-center justify-between",
330
- n ? "dial-input-no-border" : "dial-input",
331
- N && "dial-input-error",
360
+ t ? "dial-input-no-border" : "dial-input",
361
+ y && "dial-input-error",
332
362
  u && "dial-input-disable",
333
363
  f && "dial-input-readonly",
334
- !y && "pl-1",
335
- !v && "pr-1",
364
+ !v && "pl-1",
365
+ !C && "pr-1",
336
366
  c
337
367
  ),
338
368
  children: [
339
- y && /* @__PURE__ */ t(k, { tooltip: y, children: /* @__PURE__ */ t(
369
+ v && /* @__PURE__ */ n(k, { tooltip: v, children: /* @__PURE__ */ n(
340
370
  I,
341
371
  {
342
372
  hideBorder: !0,
343
373
  containerCssClass: "rounded-r-none border-r-0",
344
374
  cssClass: "px-2 overflow-hidden overflow-ellipsis dial-small",
345
- value: y,
375
+ value: v,
346
376
  disabled: !0,
347
- elementId: y + "textBefore"
377
+ elementId: v + "textBefore"
348
378
  }
349
379
  ) }),
350
380
  R && /* @__PURE__ */ p("p", { className: "text-secondary dial-small pl-2", children: [
351
381
  " ",
352
382
  R
353
383
  ] }),
354
- /* @__PURE__ */ t(w, { icon: e, className: "pl-2" }),
355
- /* @__PURE__ */ t(k, { tooltip: s, triggerClassName: i, children: /* @__PURE__ */ t(
384
+ /* @__PURE__ */ n(N, { icon: e, className: "pl-2" }),
385
+ /* @__PURE__ */ n(k, { tooltip: s, triggerClassName: i, children: /* @__PURE__ */ n(
356
386
  "input",
357
387
  {
358
388
  type: m,
359
389
  autoComplete: "off",
360
390
  id: o,
361
- placeholder: l,
391
+ placeholder: a,
362
392
  value: s ?? "",
363
393
  title: s ? String(s) : "",
364
394
  disabled: u,
365
- className: d("border-0 bg-transparent px-2", a),
366
- onChange: (h) => !f && _?.(h),
395
+ className: d("border-0 bg-transparent px-2", l),
396
+ onChange: (b) => !f && _?.(b),
367
397
  onKeyDown: U,
368
398
  onWheel: M,
369
- min: b,
399
+ min: h,
370
400
  max: g
371
401
  }
372
402
  ) }),
373
- /* @__PURE__ */ t(w, { icon: r, className: "pr-2" }),
403
+ /* @__PURE__ */ n(N, { icon: r, className: "pr-2" }),
374
404
  P && /* @__PURE__ */ p("p", { className: "text-secondary dial-small pr-2", children: [
375
405
  " ",
376
406
  P
377
407
  ] }),
378
- v && /* @__PURE__ */ t(k, { tooltip: v, children: /* @__PURE__ */ t(
408
+ C && /* @__PURE__ */ n(k, { tooltip: C, children: /* @__PURE__ */ n(
379
409
  I,
380
410
  {
381
411
  hideBorder: !0,
382
412
  containerCssClass: "rounded-l-none border-l-0",
383
413
  cssClass: "px-2",
384
- value: v,
414
+ value: C,
385
415
  disabled: !0,
386
- elementId: v + "textAfter"
416
+ elementId: C + "textAfter"
387
417
  }
388
418
  ) })
389
419
  ]
390
420
  }
391
421
  );
392
- }, Re = /^0+\.(\d+)?$/, Pe = /^0+/, L = ({
422
+ }, Ee = /^0+\.(\d+)?$/, Le = /^0+/, z = ({
393
423
  fieldTitle: e,
394
424
  errorText: r,
395
- optional: n,
425
+ optional: t,
396
426
  elementCssClass: s,
397
427
  elementContainerCssClass: o,
398
- elementId: l,
399
- containerCssClass: a,
428
+ elementId: a,
429
+ containerCssClass: l,
400
430
  readonly: c,
401
431
  defaultEmptyText: i,
402
432
  min: m,
403
433
  max: u,
404
434
  ...f
405
- }) => /* @__PURE__ */ p("div", { className: d("flex flex-col", a), children: [
406
- /* @__PURE__ */ t(
435
+ }) => /* @__PURE__ */ p("div", { className: d("flex flex-col", l), children: [
436
+ /* @__PURE__ */ n(
407
437
  A,
408
438
  {
409
439
  fieldTitle: e,
410
- optional: n,
411
- htmlFor: l
440
+ optional: t,
441
+ htmlFor: a
412
442
  }
413
443
  ),
414
- c ? /* @__PURE__ */ t("span", { children: f.value || (i ?? "None") }) : /* @__PURE__ */ p(K, { children: [
415
- /* @__PURE__ */ t(
444
+ c ? /* @__PURE__ */ n("span", { children: f.value || (i ?? "None") }) : /* @__PURE__ */ p(K, { children: [
445
+ /* @__PURE__ */ n(
416
446
  I,
417
447
  {
418
- elementId: l,
448
+ elementId: a,
419
449
  cssClass: s,
420
450
  containerCssClass: o,
421
451
  invalid: r != null,
@@ -424,117 +454,118 @@ const he = {
424
454
  ...f
425
455
  }
426
456
  ),
427
- /* @__PURE__ */ t(z, { errorText: r })
457
+ /* @__PURE__ */ n(L, { errorText: r })
428
458
  ] })
429
- ] }), Le = ({
459
+ ] }), _e = ({
430
460
  onChange: e,
431
461
  value: r,
432
- min: n,
462
+ min: t,
433
463
  max: s,
434
464
  ...o
435
465
  }) => {
436
- const l = (a) => String(a)?.match(Re) ? String(a)?.replace(Pe, "0") : Number(a);
437
- return /* @__PURE__ */ t(
438
- L,
466
+ const a = (l) => String(l)?.match(Ee) ? String(l)?.replace(Le, "0") : Number(l);
467
+ return /* @__PURE__ */ n(
468
+ z,
439
469
  {
440
470
  type: "number",
441
- onChange: (a) => e?.(l(a)),
471
+ onChange: (l) => e?.(a(l)),
442
472
  value: r,
443
- min: n,
473
+ min: t,
444
474
  max: s,
445
475
  ...o
446
476
  }
447
477
  );
448
- }, Me = ({
478
+ }, Ke = ({
449
479
  onChange: e,
450
480
  ...r
451
- }) => /* @__PURE__ */ t(
452
- L,
481
+ }) => /* @__PURE__ */ n(
482
+ z,
453
483
  {
454
484
  type: "text",
455
- onChange: (n) => e?.(n),
485
+ onChange: (t) => e?.(t),
456
486
  ...r
457
487
  }
458
- ), He = ({
488
+ ), Be = ({
459
489
  fieldTitle: e,
460
490
  optional: r,
461
- elementId: n,
491
+ elementId: t,
462
492
  elementCssClass: s,
463
493
  errorText: o,
464
- ...l
494
+ ...a
465
495
  }) => /* @__PURE__ */ p("div", { className: "flex flex-col", children: [
466
- /* @__PURE__ */ t(
496
+ /* @__PURE__ */ n(
467
497
  A,
468
498
  {
469
499
  fieldTitle: e,
470
500
  optional: r,
471
- htmlFor: n
501
+ htmlFor: t
472
502
  }
473
503
  ),
474
- /* @__PURE__ */ t(
475
- ke,
504
+ /* @__PURE__ */ n(
505
+ Re,
476
506
  {
477
- textareaId: n,
507
+ textareaId: t,
478
508
  cssClass: s,
479
- ...l
509
+ ...a
480
510
  }
481
511
  ),
482
- /* @__PURE__ */ t(z, { errorText: o })
483
- ] }), Ue = ({
512
+ /* @__PURE__ */ n(L, { errorText: o })
513
+ ] }), Ge = ({
484
514
  title: e,
485
515
  switchId: r,
486
- isOn: n = !1,
516
+ isOn: t = !1,
487
517
  disabled: s,
488
518
  onChange: o
489
519
  }) => {
490
- const l = d(
491
- "flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
492
- n ? "flex-row-reverse" : "flex-row",
520
+ const a = d(
521
+ "flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",
522
+ t ? "flex-row-reverse" : "flex-row",
493
523
  s ? "pointer-events-none" : "",
494
- s ? n ? "bg-controls-disable" : "bg-layer-4" : n ? "bg-accent-primary" : "bg-layer-4"
495
- ), a = fe(
524
+ s ? t ? "bg-controls-disable" : "bg-layer-4" : t ? "bg-accent-primary" : "bg-layer-4"
525
+ ), l = ge(
496
526
  (c) => {
497
- c.stopPropagation(), o?.(!n);
527
+ c.stopPropagation(), o?.(!t);
498
528
  },
499
- [o, n]
529
+ [o, t]
500
530
  );
501
531
  return /* @__PURE__ */ p("div", { className: "flex flex-row items-center", children: [
502
- /* @__PURE__ */ t(
532
+ /* @__PURE__ */ n(
503
533
  "input",
504
534
  {
505
535
  type: "checkbox",
506
- onChange: a,
536
+ onChange: l,
507
537
  id: r,
508
538
  disabled: s,
509
539
  className: "invisible w-0 h-0",
510
- checked: n
540
+ checked: t
511
541
  }
512
542
  ),
513
- /* @__PURE__ */ t("label", { htmlFor: r, className: l, children: /* @__PURE__ */ t(
543
+ /* @__PURE__ */ n("label", { htmlFor: r, className: a, children: /* @__PURE__ */ n(
514
544
  "span",
515
545
  {
516
546
  className: d(
517
547
  "size-3 rounded-full",
518
- s ? n ? "bg-controls-disable" : "bg-layer-4" : "bg-controls-enable-primary"
548
+ s ? t ? "bg-layer-4" : "bg-controls-disable" : "bg-controls-enable-primary"
519
549
  )
520
550
  }
521
551
  ) }),
522
- e && /* @__PURE__ */ t("span", { className: "h-[14px] pl-2 small text-primary", children: e })
552
+ e && /* @__PURE__ */ n("span", { className: "pl-2 dial-small text-primary", children: e })
523
553
  ] });
524
554
  };
525
555
  export {
526
556
  x as AlertVariant,
527
- D as ButtonVariant,
528
- je as DialAlert,
557
+ T as ButtonVariant,
558
+ He as DialAlert,
529
559
  be as DialButton,
530
- z as DialErrorText,
560
+ L as DialErrorText,
531
561
  A as DialFieldLabel,
532
- w as DialIcon,
562
+ N as DialIcon,
533
563
  I as DialInput,
534
- Le as DialNumberInputField,
535
- Ue as DialSwitch,
536
- He as DialTextAreaField,
537
- Me as DialTextInputField,
538
- ke as DialTextarea,
564
+ Ue as DialLoader,
565
+ _e as DialNumberInputField,
566
+ Ge as DialSwitch,
567
+ Be as DialTextAreaField,
568
+ Ke as DialTextInputField,
569
+ Re as DialTextarea,
539
570
  k as DialTooltip
540
571
  };
package/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
1
  .dial-h1{font-weight:600}.dial-h1,.dial-h2{font-size:20px;line-height:24px}.dial-h2{font-weight:400}.dial-h3{font-weight:600;line-height:18px}.dial-body,.dial-h3{font-size:16px}.dial-body{font-weight:400;line-height:28px}.dial-small{font-weight:400}.dial-small,.dial-small-semi{font-size:14px;line-height:16px}.dial-small-semi{font-weight:600}.dial-small-medium{font-weight:400;font-size:14px;line-height:16px}.dial-small-150{font-weight:400;font-size:14px;line-height:21px}.dial-tiny{line-height:14px}.dial-tiny,.dial-tiny-150{font-weight:400;font-size:12px}.dial-tiny-150{line-height:18px}.dial-caption{font-weight:400;font-size:10px;line-height:12px}h1{font-weight:600}h1,h2{font-size:20px;line-height:24px}h2{font-weight:400}h3{font-weight:600;font-size:16px;line-height:18px}.dial-base-button{display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px}.dial-base-button-disable{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}.dial-primary-button{background-color:var(--controls-bg-accent,#5c8dea);color:var(--controls-primary,#fcfcfc);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;&:focus,&:hover{background-color:var(--controls-bg-accent-hover,#4878d2)}&:focus{border-color:var(--stroke-hover,#f3f4f6)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-secondary-button{background-color:transparent;color:var(--text-primary,#f3f4f6);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;border-color:var(--stroke-primary,#333942);&:focus,&:hover{background-color:var(--bg-layer-4,#333942)}&:focus{border-color:var(--stroke-hover,#f3f4f6)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-tertiary-button{background-color:transparent;color:var(--text-accent-primary,#5c8dea);display:flex;flex-direction:row;align-items:center;padding:.5rem .75rem;border-radius:3px;border:1px solid transparent;font-weight:400;font-size:14px;line-height:16px;min-width:38px;min-height:38px;&:focus,&:hover{background-color:var(--controls-bg-accent-alpha,#5c8dea2b)}&:active,&:focus{border-color:var(--stroke-accent-primary,#5c8dea)}&:disabled{pointer-events:none;background-color:var(--controls-bg-disable,#7f8792);color:var(--controls-disable,#333942)}}.dial-input{border-radius:3px;border-width:1px;border-style:solid;border-color:var(--stroke-primary,#333942);&:hover{border-color:var(--stroke-hover,#f3f4f6)}&:focus,&:focus-within{border-color:var(--stroke-accent-primary,#5c8dea)}}.dial-input,.dial-input-no-border{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:transparent;font-weight:400;font-size:14px;line-height:16px;width:100%;padding:.5rem .75rem;outline-width:0;&:not(:-moz-placeholder){color:var(--text-primary,#f3f4f6)}&:not(:placeholder-shown){color:var(--text-primary,#f3f4f6)}&:disabled{background-color:var(--bg-layer-3,#222932)}&:disabled:not(:-moz-placeholder){color:var(--text-secondary,#7f8792)}&:disabled,&:disabled:not(:placeholder-shown){color:var(--text-secondary,#7f8792)}}.dial-input-disable,.dial-input-readonly{background-color:var(--bg-layer-3,#222932)}.dial-input-disable:not(:-moz-placeholder){color:var(--text-secondary,#7f8792)}.dial-input-disable,.dial-input-disable:not(:placeholder-shown){color:var(--text-secondary,#7f8792)}.dial-input-error{border-color:var(--stroke-error,#f76464)}.dial-input-field{height:38px}input{-moz-appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}&:focus{outline:none}}.dial-textarea{min-height:72px;resize:both;overflow:auto;white-space:normal}@layer ui{*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
2
- /*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.relative{position:relative}.z-\[55\]{z-index:55}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-3{width:.75rem;height:.75rem}.h-0{height:0}.h-\[14px\]{height:14px}.h-\[18px\]{height:18px}.h-\[300px\]{height:300px}.h-\[38px\]{height:38px}.min-h-4{min-height:1rem}.min-h-\[72px\]{min-height:72px}.w-0{width:0}.w-2{width:.5rem}.w-80{width:20rem}.w-\[250px\]{width:250px}.w-\[36px\]{width:36px}.w-\[500px\]{width:500px}.w-full{width:100%}.min-w-\[800px\]{min-width:800px}.max-w-80{max-width:20rem}.max-w-\[1000px\]{max-width:1000px}.max-w-\[1200px\]{max-width:1200px}.max-w-\[1400px\]{max-width:1400px}.max-w-\[300px\]{max-width:300px}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\[minmax\(0\2c 100px\)_1fr\]{grid-template-columns:minmax(0,100px) 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-\[160px\]{-moz-column-gap:160px;column-gap:160px}.gap-y-10{row-gap:2.5rem}.gap-y-\[80px\]{row-gap:80px}.overflow-hidden,.truncate{overflow:hidden}.truncate{white-space:nowrap}.overflow-ellipsis,.truncate{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-0{border-width:0}.border-l-0{border-left-width:0}.border-r-0{border-right-width:0}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-error{border-color:var(--stroke-error,#f76464)}.border-primary{border-color:var(--stroke-primary,#333942)}.bg-accent-primary{background-color:var(--bg-accent-primary,#5c8dea)}.bg-blackout{background-color:var(--bg-blackout,#090d13b3)}.bg-controls-accent{background-color:var(--controls-bg-accent,#5c8dea)}.bg-controls-disable{background-color:var(--controls-bg-disable,#7f8792)}.bg-controls-enable-primary{background-color:var(--controls-enable-primary,#fcfcfc)}.bg-error{background-color:var(--bg-error,#402027)}.bg-info{background-color:var(--bg-info,#1c2c47)}.bg-layer-2{background-color:var(--bg-layer-2,#141a23)}.bg-layer-3{background-color:var(--bg-layer-3,#222932)}.bg-layer-4{background-color:var(--bg-layer-4,#333942)}.bg-success{background-color:var(--bg-success,#1d3841)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--bg-warning,#3f3d25)}.stroke-primary{stroke:var(--stroke-primary,#333942)}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\[var\(--bg-layer-0\2c _\#000000\)\]{color:var(--bg-layer-0,#000)}.text-accent-primary{color:var(--text-accent-primary,#5c8dea)}.text-controls-disable{color:var(--controls-disable,#333942)}.text-error{color:var(--text-error,#f76464)}.text-icon-accent-primary{color:var(--icon-accent-primary,#5c8dea)}.text-icon-accent-secondary{color:var(--icon-accent-secondary,#37babc)}.text-info{color:var(--text-info,#5c8dea)}.text-primary{color:var(--text-primary,#f3f4f6)}.text-secondary{color:var(--text-secondary,#7f8792)}.text-success{color:var(--text-success,#37babc)}.text-warning{color:var(--text-warning,#f4ce46)}.shadow{--tw-shadow:0 0 4px 0 var(--bg-blackout,#090d13b3);--tw-shadow-colored:0 0 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.outline-offset-0{outline-offset:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}}.hover\:text-primary:hover{color:var(--text-primary,#f3f4f6)}.focus-visible\:outline:focus-visible{outline-style:solid}@media (min-width:640px){.sm\:inline{display:inline}}
2
+ /*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.relative{position:relative}.z-\[55\]{z-index:55}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-3{width:.75rem;height:.75rem}.h-0{height:0}.h-\[18px\]{height:18px}.h-\[300px\]{height:300px}.h-\[38px\]{height:38px}.h-full{height:100%}.min-h-4{min-height:1rem}.min-h-\[72px\]{min-height:72px}.w-0{width:0}.w-2{width:.5rem}.w-80{width:20rem}.w-\[250px\]{width:250px}.w-\[36px\]{width:36px}.w-\[500px\]{width:500px}.w-full{width:100%}.min-w-\[800px\]{min-width:800px}.max-w-80{max-width:20rem}.max-w-\[1000px\]{max-width:1000px}.max-w-\[1200px\]{max-width:1200px}.max-w-\[1400px\]{max-width:1400px}.max-w-\[300px\]{max-width:300px}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow-0{flex-grow:0}.basis-auto{flex-basis:auto}.border-collapse{border-collapse:collapse}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-steps{animation:spin .75s steps(6) infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\[minmax\(0\2c 100px\)_1fr\]{grid-template-columns:minmax(0,100px) 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-\[160px\]{-moz-column-gap:160px;column-gap:160px}.gap-y-10{row-gap:2.5rem}.gap-y-6{row-gap:1.5rem}.gap-y-\[80px\]{row-gap:80px}.overflow-hidden,.truncate{overflow:hidden}.truncate{white-space:nowrap}.overflow-ellipsis,.truncate{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border{border-width:1px}.border-0{border-width:0}.border-l-0{border-left-width:0}.border-r-0{border-right-width:0}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-error{border-color:var(--stroke-error,#f76464)}.border-primary{border-color:var(--stroke-primary,#333942)}.bg-accent-primary{background-color:var(--bg-accent-primary,#5c8dea)}.bg-blackout{background-color:var(--bg-blackout,#090d13b3)}.bg-controls-accent{background-color:var(--controls-bg-accent,#5c8dea)}.bg-controls-disable{background-color:var(--controls-bg-disable,#7f8792)}.bg-controls-enable-primary{background-color:var(--controls-enable-primary,#fcfcfc)}.bg-error{background-color:var(--bg-error,#402027)}.bg-info{background-color:var(--bg-info,#1c2c47)}.bg-layer-2{background-color:var(--bg-layer-2,#141a23)}.bg-layer-3{background-color:var(--bg-layer-3,#222932)}.bg-layer-4{background-color:var(--bg-layer-4,#333942)}.bg-success{background-color:var(--bg-success,#1d3841)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--bg-warning,#3f3d25)}.stroke-primary{stroke:var(--stroke-primary,#333942)}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-\[var\(--bg-layer-0\2c _\#000000\)\]{color:var(--bg-layer-0,#000)}.text-accent-primary{color:var(--text-accent-primary,#5c8dea)}.text-controls-disable{color:var(--controls-disable,#333942)}.text-error{color:var(--text-error,#f76464)}.text-icon-accent-primary{color:var(--icon-accent-primary,#5c8dea)}.text-icon-accent-secondary{color:var(--icon-accent-secondary,#37babc)}.text-info{color:var(--text-info,#5c8dea)}.text-primary{color:var(--text-primary,#f3f4f6)}.text-secondary{color:var(--text-secondary,#7f8792)}.text-success{color:var(--text-success,#37babc)}.text-warning{color:var(--text-warning,#f4ce46)}.shadow{--tw-shadow:0 0 4px 0 var(--bg-blackout,#090d13b3);--tw-shadow-colored:0 0 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.outline-offset-0{outline-offset:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}}.hover\:text-primary:hover{color:var(--text-primary,#f3f4f6)}.focus-visible\:outline:focus-visible{outline-style:solid}@media (min-width:640px){.sm\:inline{display:inline}}
@@ -0,0 +1,32 @@
1
+ import { FC } from 'react';
2
+ export interface DialLoaderProps {
3
+ size?: number;
4
+ cssClass?: string;
5
+ iconClass?: string;
6
+ fullWidth?: boolean;
7
+ ariaLabel?: string;
8
+ }
9
+ /**
10
+ * A simple loading spinner component.
11
+ *
12
+ * Renders a spinning SVG with optional full-width container.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * // Full width (default)
17
+ * <DialLoader />
18
+ *
19
+ * // Inline (content width)
20
+ * <DialLoader fullWidth={false} />
21
+ *
22
+ * // Custom size and classes
23
+ * <DialLoader size={24} iconClass="text-accent-primary" />
24
+ * ```
25
+ *
26
+ * @param [size=18] - Icon size in px
27
+ * @param [cssClass] - Additional classes for the container
28
+ * @param [iconClass] - Additional classes for the SVG icon
29
+ * @param [fullWidth=true] - Stretch to full width/height of container
30
+ * @param [ariaLabel='Loading'] - Accessible label for screen readers
31
+ */
32
+ export declare const DialLoader: FC<DialLoaderProps>;
@@ -0,0 +1,2 @@
1
+ export declare const loaderBaseClasses = "flex items-center justify-center text-secondary";
2
+ export declare const loaderIconBaseClasses = "shrink-0 grow-0 basis-auto animate-spin-steps";
@@ -3,6 +3,7 @@ export { DialErrorText } from './components/ErrorText/ErrorText';
3
3
  export { DialFieldLabel } from './components/Field/Field';
4
4
  export { DialIcon } from './components/Icon/Icon';
5
5
  export { DialAlert } from './components/Alert/Alert';
6
+ export { DialLoader } from './components/Loader/Loader';
6
7
  export { DialTextarea } from './components/Textarea/Textarea';
7
8
  export { DialTextAreaField } from './components/TextAreaField/TextAreaField';
8
9
  export { DialTooltip } from './components/Tooltip/Tooltip';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.2.0-rc.6",
3
+ "version": "0.2.0-rc.8",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",