@nice2dev/ui 1.2.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +474 -0
  2. package/dist/NiceButton-CnAIqCbd.js +101 -0
  3. package/dist/NiceButton-DzCqkG5a.cjs +1 -0
  4. package/dist/NiceCodeEditor-CK6B54mu.js +1215 -0
  5. package/dist/NiceCodeEditor-bJReZPDO.cjs +268 -0
  6. package/dist/NiceColorPicker-BV3olE3M.cjs +1 -0
  7. package/dist/NiceColorPicker-CyY-4q89.js +552 -0
  8. package/dist/NiceDataGrid-BQIqitMM.cjs +10 -0
  9. package/dist/NiceDataGrid-C1eI6Pso.js +2267 -0
  10. package/dist/NiceDataGrid-Cs4vOOTE.js +2267 -0
  11. package/dist/NiceDataGrid-jZvzaCv3.cjs +10 -0
  12. package/dist/NiceForm-CfAPcXdX.cjs +1 -0
  13. package/dist/NiceForm-DYcrWaN1.js +5017 -0
  14. package/dist/NiceForm-DfKYNQti.js +5017 -0
  15. package/dist/NiceForm-ZzfYumoR.cjs +1 -0
  16. package/dist/NiceGantt-TEXbAELi.js +333 -0
  17. package/dist/NiceGantt-s2cgt5zD.cjs +1 -0
  18. package/dist/NiceHtmlEditor-CDZeF_zG.cjs +10 -0
  19. package/dist/NiceHtmlEditor-CdWgddg3.js +901 -0
  20. package/dist/NiceLoginForm-DRPldHXa.js +808 -0
  21. package/dist/NiceLoginForm-IGLUCQUE.cjs +1 -0
  22. package/dist/NiceMention-CgDp0sl9.cjs +430 -0
  23. package/dist/NiceMention-DBvFvx71.js +11653 -0
  24. package/dist/NiceMention-VhH0Dllr.cjs +430 -0
  25. package/dist/NiceMention-cOqXnI0M.js +11653 -0
  26. package/dist/NiceMention.css +1 -1
  27. package/dist/NiceModal-BlYhFDhP.js +80 -0
  28. package/dist/NiceModal-DmWz2PDM.cjs +1 -0
  29. package/dist/NiceModuleLifecyclePanel-BWUYyWfY.cjs +1 -0
  30. package/dist/NiceModuleLifecyclePanel-BdcJATGF.js +7190 -0
  31. package/dist/NiceModuleLifecyclePanel-D8EoXqBy.cjs +1 -0
  32. package/dist/NiceModuleLifecyclePanel-SN6G7t64.js +7189 -0
  33. package/dist/NiceModuleLifecyclePanel.css +1 -1
  34. package/dist/NicePagination-BJS65foT.js +200 -0
  35. package/dist/NicePagination-D_3GfWp5.cjs +1 -0
  36. package/dist/NicePivotGrid-D_kRF1Dt.js +1180 -0
  37. package/dist/NicePivotGrid-DqluEkCI.cjs +152 -0
  38. package/dist/NiceSavedQueryPanel-C2Tn1cMW.js +5311 -0
  39. package/dist/NiceSavedQueryPanel-Cs_dypgU.js +5311 -0
  40. package/dist/NiceSavedQueryPanel-DDKtL1AA.cjs +586 -0
  41. package/dist/NiceSavedQueryPanel-DTSOHW2v.cjs +586 -0
  42. package/dist/NiceScheduler-BmHcJLBe.cjs +5 -0
  43. package/dist/NiceScheduler-DI2sg3Rr.js +1710 -0
  44. package/dist/NiceScheduler-GJLvkXJ3.cjs +5 -0
  45. package/dist/NiceScheduler-UT49u2Vq.js +1710 -0
  46. package/dist/NiceSelect-CdUHd8rj.cjs +1 -0
  47. package/dist/NiceSelect-fOelG_QB.js +495 -0
  48. package/dist/NiceWindow-CqSsTjrS.cjs +1 -0
  49. package/dist/NiceWindow-DZLPhXbR.js +2223 -0
  50. package/dist/charts-BYQwl_GS.js +4789 -0
  51. package/dist/charts-C6iOu0H6.cjs +768 -0
  52. package/dist/charts.cjs +1 -1
  53. package/dist/charts.d.ts +1 -1
  54. package/dist/charts.mjs +1 -1
  55. package/dist/core-lazy-B_laOXNf.cjs +1 -0
  56. package/dist/core-lazy-BpbIO1EN.cjs +1 -0
  57. package/dist/core-lazy-L7MVTPp1.js +351 -0
  58. package/dist/core-lazy-VQEjdz0L.js +351 -0
  59. package/dist/data-branching-7rpktFJ-.cjs +1 -0
  60. package/dist/data-branching-BS0aFUMu.js +6428 -0
  61. package/dist/data-branching.cjs +1 -1
  62. package/dist/data-branching.mjs +1 -1
  63. package/dist/data.cjs +1 -1
  64. package/dist/data.mjs +3 -3
  65. package/dist/devops-CFytAJQr.cjs +18 -0
  66. package/dist/devops-CW8YY_zA.js +9122 -0
  67. package/dist/devops.cjs +1 -1
  68. package/dist/devops.css +1 -0
  69. package/dist/devops.mjs +5 -5
  70. package/dist/editors.cjs +1 -1
  71. package/dist/editors.mjs +8 -8
  72. package/dist/feedback.cjs +1 -1
  73. package/dist/feedback.d.ts +21 -16
  74. package/dist/feedback.mjs +3 -3
  75. package/dist/index.cjs +262 -257
  76. package/dist/index.css +1 -1
  77. package/dist/index.d.ts +402 -27
  78. package/dist/index.mjs +21437 -20148
  79. package/dist/lazy.cjs +1 -1
  80. package/dist/lazy.mjs +24 -24
  81. package/dist/navigation.cjs +1 -1
  82. package/dist/navigation.d.ts +50 -7
  83. package/dist/navigation.mjs +404 -354
  84. package/dist/no-code-BaAI_sJR.js +8318 -0
  85. package/dist/no-code-oQTeAtnW.cjs +331 -0
  86. package/dist/no-code.cjs +1 -1
  87. package/dist/no-code.mjs +1 -1
  88. package/dist/overlays.cjs +1 -1
  89. package/dist/overlays.d.ts +5 -0
  90. package/dist/overlays.mjs +1 -1
  91. package/dist/pickerCommons-BQi6IEAt.js +661 -0
  92. package/dist/pickerCommons-CUGHOWyc.cjs +1 -0
  93. package/dist/pickerCommons-D-dwdCBZ.js +659 -0
  94. package/dist/pickerCommons-DvQptSPX.cjs +1 -0
  95. package/dist/pickerCommons.css +1 -1
  96. package/dist/style.css +8 -5
  97. package/package.json +4 -3
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),f=require("@nice2dev/ui-core"),n=require("react"),H=require("./NiceButton-DzCqkG5a.cjs"),q={info:e.jsx(f.NiceIcon,{name:"info",size:20}),success:e.jsx(f.NiceIcon,{name:"success",size:20}),warning:e.jsx(f.NiceIcon,{name:"warning",size:20}),error:e.jsx(f.NiceIcon,{name:"error",size:20})},V=({variant:t="info",title:r,children:a,closable:c,onClose:s,icon:i,size:m="md",className:o,style:d,displayStyle:b})=>{const{t:h}=f.useNiceTranslation(),_=f.useComponentDisplayClass("card",b);return e.jsxs("div",{className:`nice-alert nice-alert--${t} nice-alert--${m} nice-alert--ds-${_} ${o||""}`,style:d,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${t}`,children:i||q[t]}),e.jsxs("div",{className:"nice-alert__content",children:[r&&e.jsx("div",{className:"nice-alert__title",children:r}),e.jsx("div",{children:a})]}),c&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:s,"aria-label":h("alert.close","Close"),children:e.jsx(f.NiceIcon,{name:"close",size:16})})]})},W=({open:t,onClose:r,title:a,position:c="right",size:s="md",children:i,footer:m,transitionDuration:o,className:d,style:b,displayStyle:h})=>{const _=f.useComponentDisplayStyle("modal",h),y=f.useComponentDisplayClass("modal",h),{t:l}=f.useNiceTranslation(),p=n.useRef(null);return f.useOverlayFocus(p,{open:t,onClose:r}),n.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onMouseDown:x=>{x.target===x.currentTarget&&r()}}),e.jsxs("div",{ref:p,className:`nice-drawer nice-drawer--${c} nice-drawer--${s} nice-drawer--ds-${y} ${d||""}`,style:{..._,...b,...o!=null?{transitionDuration:`${o}ms`}:{}},role:"dialog","aria-modal":"true","aria-label":a,children:[a&&e.jsxs("div",{className:"nice-drawer__header",children:[e.jsx("h3",{className:"nice-drawer__title",children:a}),e.jsx("button",{type:"button",className:"nice-drawer__close",onClick:r,"aria-label":l("controls.close","Close"),children:e.jsx(f.NiceIcon,{name:"close",size:18})})]}),e.jsx("div",{className:"nice-drawer__body",children:i}),m&&e.jsx("div",{className:"nice-drawer__footer",children:m})]})]}):null},U=({toasts:t,onDismiss:r,position:a="top-right"})=>{const{t:c}=f.useNiceTranslation(),s=n.useRef(null),i=n.useRef(null);f.useInputHints(s,[{intent:"back",label:c("toast.dismiss","Dismiss")}]);const m=n.useCallback(o=>{const d=s.current;if(!d||!o.contains(document.activeElement))return;const b=[...d.querySelectorAll(".nice-toast:not(.nice-toast--exiting)")],h=b.indexOf(o),_=b[h+1]??b[h-1];(_&&_!==o?_.querySelector("button"):i.current?.isConnected?i.current:null)?.focus()},[]);return n.useEffect(()=>{const o=s.current;if(!o)return;const d=b=>{const h=b.relatedTarget;h instanceof HTMLElement&&!o.contains(h)&&(i.current=h)};return o.addEventListener("focusin",d),()=>o.removeEventListener("focusin",d)},[]),e.jsx("div",{ref:s,className:`nice-toast-container nice-toast-container--${a}`,role:"region","aria-label":c("toast.region","Notifications"),children:t.map(o=>e.jsx(K,{toast:o,onDismiss:r,onLeave:m},o.id))})},K=({toast:t,onDismiss:r,onLeave:a})=>{const{t:c}=f.useNiceTranslation(),s=n.useRef(null),[i,m]=n.useState(!1),[o,d]=n.useState(!1),[b,h]=n.useState(!1),_=o||b,y=n.useCallback(()=>{s.current&&a(s.current),m(!0)},[a]);return n.useEffect(()=>{if(_||i)return;const l=t.duration??4e3;if(l>0){const p=setTimeout(()=>m(!0),l);return()=>clearTimeout(p)}},[t.duration,_,i]),n.useEffect(()=>{if(i){const l=setTimeout(()=>r(t.id),200);return()=>clearTimeout(l)}},[i,t.id,r]),n.useEffect(()=>{const l=s.current;if(!l)return;const p=g=>{g.key==="Escape"&&!g.defaultPrevented&&(g.preventDefault(),y())},x=()=>d(!0),u=()=>d(!1),j=()=>h(!0),v=g=>{l.contains(g.relatedTarget)||h(!1)};return l.addEventListener("keydown",p),l.addEventListener("mouseenter",x),l.addEventListener("mouseleave",u),l.addEventListener("focusin",j),l.addEventListener("focusout",v),()=>{l.removeEventListener("keydown",p),l.removeEventListener("mouseenter",x),l.removeEventListener("mouseleave",u),l.removeEventListener("focusin",j),l.removeEventListener("focusout",v)}},[y]),e.jsxs("div",{ref:s,className:`nice-toast nice-toast--${t.variant} ${i?"nice-toast--exiting":""}`,role:"alert",style:{position:"relative"},children:[e.jsx("div",{className:"nice-toast__icon",children:q[t.variant]}),e.jsxs("div",{className:"nice-toast__content",children:[t.title&&e.jsx("div",{className:"nice-toast__title",children:t.title}),e.jsx("div",{className:"nice-toast__message",children:t.message}),t.action&&e.jsx("button",{type:"button",className:"nice-toast__action",onClick:()=>{t.action?.onClick(),y()},children:t.action.label})]}),e.jsx("button",{type:"button",className:"nice-toast__close",onClick:y,"aria-label":c("toast.close","Close"),children:e.jsx(f.NiceIcon,{name:"close",size:16})})]})};let Y=0;function G(){const[t,r]=n.useState([]),a=n.useCallback((s,i,m)=>{const o=`toast-${++Y}`;return r(d=>[...d,{id:o,variant:s,message:i,title:m?.title,duration:m?.duration,action:m?.action}]),o},[]),c=n.useCallback(s=>{r(i=>i.filter(m=>m.id!==s))},[]);return{toasts:t,dismiss:c,info:(s,i)=>a("info",s,i),success:(s,i)=>a("success",s,i),warning:(s,i)=>a("warning",s,i),error:(s,i)=>a("error",s,i)}}function J({error:t,showRetry:r,retryLabel:a,title:c,onReset:s}){const{t:i}=f.useNiceTranslation();return e.jsxs("div",{className:"nice-error-boundary",role:"alert",children:[e.jsx("div",{className:"nice-error-boundary__icon",children:e.jsx(f.NiceIcon,{name:"warning",size:32})}),e.jsx("h2",{className:"nice-error-boundary__title",children:c??i("errorBoundary.somethingWentWrong","Something went wrong")}),e.jsx("p",{className:"nice-error-boundary__message",children:t.message}),r&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:s,children:a??i("errorBoundary.retry","Retry")})]})}const A=class A extends n.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null},this.handleReset=()=>{this.setState({hasError:!1,error:null})}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,a){this.props.onError?.(r,a)}render(){if(this.state.hasError&&this.state.error){const{fallback:r,showRetry:a=!0,retryLabel:c,title:s}=this.props;return typeof r=="function"?r(this.state.error,this.handleReset):r||e.jsx(J,{error:this.state.error,showRetry:a,retryLabel:c,title:s,onReset:this.handleReset})}return this.props.children}};A.displayName="NiceErrorBoundary";let z=A;function Q(t){return window.addEventListener("online",t),window.addEventListener("offline",t),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",t)}}function X(){return navigator.onLine}function Z(){return!0}const ee=({message:t,variant:r="warning",icon:a,online:c,size:s="md",className:i,style:m,"data-testid":o})=>{const{t:d}=f.useNiceTranslation(),b=n.useSyncExternalStore(Q,X,Z);return c??b?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${r} nice-offline-banner--${s} ${i||""}`,style:m,role:"alert","aria-live":"assertive","data-testid":o,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:a??e.jsx(f.NiceIcon,{name:"wifi",size:18})}),e.jsx("span",{className:"nice-offline-banner__message",children:t??d("offlineBanner.message","You are offline. Some features may be unavailable.")})]})},ne=({error:t,onRetry:r,retryLabel:a,title:c,autoRetrySeconds:s,variant:i="error",icon:m,size:o="md",className:d,style:b,"data-testid":h})=>{const{t:_}=f.useNiceTranslation(),y=a??_("retryPanel.retry","Retry"),l=c??_("retryPanel.operationFailed","Operation failed"),[p,x]=n.useState(s??0),u=n.useRef(void 0),j=typeof t=="string"?t:t.message,v=n.useCallback(()=>{x(s??0),r()},[r,s]);return n.useEffect(()=>{if(!(!s||s<=0))return x(s),u.current=setInterval(()=>{x(g=>g<=1?(clearInterval(u.current),r(),0):g-1)},1e3),()=>clearInterval(u.current)},[s,r]),e.jsxs("div",{className:`nice-retry-panel nice-retry-panel--${i} nice-retry-panel--${o} ${d||""}`,style:b,role:"alert","data-testid":h,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:m??e.jsx(f.NiceIcon,{name:"warning",size:24})}),e.jsxs("div",{className:"nice-retry-panel__content",children:[e.jsx("div",{className:"nice-retry-panel__title",children:l}),e.jsx("p",{className:"nice-retry-panel__message",children:j})]}),e.jsxs("div",{className:"nice-retry-panel__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:v,children:y}),s&&p>0&&e.jsx("span",{className:"nice-retry-panel__countdown",children:_("retryPanel.autoRetryInS","Auto-retry in {countdown}s").replace("{countdown}",String(p))})]})]})};function B({timeoutMs:t=1e4,slowThresholdMs:r=3e3,onTimeout:a,autoRetry:c=!1,autoRetryCount:s=3}={}){const[i,m]=n.useState(!1),[o,d]=n.useState(!1),[b,h]=n.useState(!1),[_,y]=n.useState(0),[l,p]=n.useState(0),x=n.useRef(null),u=n.useRef(null),j=n.useRef(null),v=n.useRef(0),g=n.useCallback(()=>{x.current&&clearTimeout(x.current),u.current&&clearTimeout(u.current),j.current&&clearInterval(j.current)},[]),C=n.useCallback(()=>{g(),m(!0),d(!1),h(!1),y(0),v.current=Date.now(),j.current=setInterval(()=>{y(Date.now()-v.current)},200),x.current=setTimeout(()=>{d(!0)},r),u.current=setTimeout(()=>{h(!0),m(!1),d(!1),g(),a?.()},t)},[g,r,t,a]),T=n.useCallback(()=>{g(),m(!1),d(!1)},[g]),N=n.useCallback(()=>{p(w=>w+1),h(!1),C()},[C]);return n.useEffect(()=>()=>g(),[g]),n.useEffect(()=>{if(c&&b&&l<s){const w=Math.pow(2,l)*1e3,I=setTimeout(()=>N(),w);return()=>clearTimeout(I)}},[c,s,b,l,N]),{isLoading:i,isSlow:o,isTimedOut:b,elapsed:_,retryCount:l,start:C,stop:T,retry:N}}const se=({timeoutMs:t=1e4,slowThresholdMs:r=3e3,onTimeout:a,onRetry:c,autoRetry:s=!1,autoRetryCount:i=3,showProgress:m=!0,slowMessage:o,timeoutMessage:d,loading:b,children:h,size:_="md",className:y,style:l,"data-testid":p})=>{const{t:x}=f.useNiceTranslation(),{isSlow:u,isTimedOut:j,elapsed:v,start:g,stop:C,retry:T}=B({timeoutMs:t,slowThresholdMs:r,onTimeout:a,autoRetry:s,autoRetryCount:i}),N=n.useRef(g);N.current=g;const w=n.useRef(C);w.current=C,n.useEffect(()=>{b?N.current():w.current()},[b]);const I=()=>{T(),c?.()};if(!b)return e.jsx(e.Fragment,{children:h});if(j)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${_} ${y??""}`,style:l,role:"alert","data-testid":p,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:d??x("timeoutFeedback.timeout","The operation timed out. Please try again.")}),e.jsx(H.NiceButton,{size:"sm",className:"nice-timeout-feedback__retry-btn",onClick:I,children:x("timeoutFeedback.retry","Try again")})]});const E=Math.min(100,v/t*100);return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--${_} ${u?"nice-timeout-feedback--slow":""} ${y??""}`,style:l,role:"status","aria-busy":"true","data-testid":p,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-hidden":"true"}),u&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:o??x("timeoutFeedback.slow","This is taking longer than usual…")}),m&&e.jsx("div",{className:"nice-timeout-feedback__progress",role:"progressbar","aria-label":x("timeoutFeedback.progress","Time until timeout"),"aria-valuenow":Math.round(E),"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"nice-timeout-feedback__progress-bar",style:{width:`${E}%`}})})]})},te=Object.assign(n.forwardRef(({visible:t,onAcceptAll:r,onRejectAll:a,onSave:c,categories:s=["necessary","analytics","marketing","preferences"],defaults:i,position:m="bottom",size:o="md",policyUrl:d,showDetails:b=!1,className:h,style:_,id:y,...l},p)=>{const x=f.useControlId(y),{t:u}=f.useNiceTranslation(),[j,v]=n.useState(!0),g=t??j,[C,T]=n.useState(b),[N,w]=n.useState(()=>{const k={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return i&&Object.assign(k,i),k.necessary=!0,k}),I={necessary:u("cookie.necessary","Necessary"),analytics:u("cookie.analytics","Analytics"),marketing:u("cookie.marketing","Marketing"),preferences:u("cookie.preferences","Preferences")},E={necessary:u("cookie.necessaryDesc","Required for the website to function. Cannot be disabled."),analytics:u("cookie.analyticsDesc","Help us understand how visitors interact with the website."),marketing:u("cookie.marketingDesc","Used to deliver relevant advertisements."),preferences:u("cookie.preferencesDesc","Allow the website to remember your choices.")},D=n.useCallback(()=>{const k={necessary:!0,analytics:!0,marketing:!0,preferences:!0};r?.(),c?.(k),v(!1)},[r,c]),L=n.useCallback(()=>{const k={necessary:!0,analytics:!1,marketing:!1,preferences:!1};a?.(),c?.(k),v(!1)},[a,c]),P=n.useCallback(()=>{c?.({...N,necessary:!0}),v(!1)},[N,c]),$=n.useRef(null);f.useOverlayFocus($,{open:g});const O=n.useCallback(k=>{$.current=k,typeof p=="function"?p(k):p&&(p.current=k)},[p]);return g?e.jsx("div",{ref:O,id:x,className:`nice-cookie-consent nice-cookie-consent--${m} nice-cookie-consent--${o} ${h??""}`,style:_,role:"dialog","aria-label":u("cookie.label","Cookie Consent"),"aria-modal":"true",...l,children:e.jsxs("div",{className:"nice-cookie-consent__content",children:[e.jsxs("p",{className:"nice-cookie-consent__message",children:[u("cookie.message","We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."),d&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:d,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:u("cookie.learnMore","Learn more")})]})]}),C&&e.jsx("div",{className:"nice-cookie-consent__details",children:s.map(k=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:N[k],disabled:k==="necessary",onChange:R=>w(F=>({...F,[k]:R.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:I[k]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:E[k]})]})]},k))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!C&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>T(!0),children:u("cookie.customize","Customize")}),C&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--save",onClick:P,children:u("cookie.savePreferences","Save preferences")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--reject",onClick:L,children:u("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:D,children:u("cookie.acceptAll","Accept all")})]})]})}):null}),{displayName:"NiceCookieConsent"}),re=Object.assign(n.forwardRef(({onSubmit:t,onForgotPassword:r,onRegister:a,loading:c=!1,error:s,variant:i="primary",size:m="md",showRememberMe:o=!0,showForgotPassword:d=!0,showRegister:b=!1,title:h,logo:_,usernameLabel:y,passwordLabel:l,usernamePlaceholder:p,passwordPlaceholder:x,className:u,style:j,id:v,...g},C)=>{const T=f.useControlId(v),{t:N}=f.useNiceTranslation(),[w,I]=n.useState(""),[E,D]=n.useState(""),[L,P]=n.useState(!1),[$,O]=n.useState(!1),k=`${T}-user`,R=`${T}-pass`,F=`${T}-remember`,M=n.useCallback(S=>{S.preventDefault(),!c&&t?.({username:w,password:E,rememberMe:L})},[c,w,E,L,t]);return e.jsxs("form",{ref:C,id:T,className:`nice-login nice-login--${i} nice-login--${m} ${u??""}`,style:j,onSubmit:M,noValidate:!0,...g,children:[_&&e.jsx("div",{className:"nice-login__logo",children:_}),h&&e.jsx("h2",{className:"nice-login__title",children:h??N("login.title","Sign In")}),s&&e.jsx("div",{className:"nice-login__error",role:"alert",children:s}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:k,className:"nice-login__label",children:y??N("login.username","Username")}),e.jsx("input",{id:k,className:"nice-login__input",type:"text",value:w,onChange:S=>I(S.target.value),placeholder:p??N("login.usernamePlaceholder","Enter your username"),autoComplete:"username",required:!0,disabled:c,"aria-required":"true"})]}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:R,className:"nice-login__label",children:l??N("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:R,className:"nice-login__input",type:$?"text":"password",value:E,onChange:S=>D(S.target.value),placeholder:x??N("login.passwordPlaceholder","Enter your password"),autoComplete:"current-password",required:!0,disabled:c,"aria-required":"true"}),e.jsx("button",{type:"button",className:"nice-login__toggle-password",onClick:()=>O(!$),"aria-label":$?N("login.hidePassword","Hide password"):N("login.showPassword","Show password"),tabIndex:-1,children:e.jsx(f.NiceIcon,{name:$?"eye-off":"eye",size:16})})]})]}),e.jsxs("div",{className:"nice-login__options",children:[o&&e.jsxs("label",{className:"nice-login__remember",htmlFor:F,children:[e.jsx("input",{id:F,type:"checkbox",checked:L,onChange:S=>P(S.target.checked),disabled:c}),e.jsx("span",{children:N("login.rememberMe","Remember me")})]}),d&&r&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:r,disabled:c,children:N("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${i}`,disabled:c||!w||!E,children:c?N("login.loading","Signing in..."):N("login.submit","Sign In")}),b&&a&&e.jsxs("p",{className:"nice-login__register",children:[N("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:a,disabled:c,children:N("login.register","Register")})]})]})}),{displayName:"NiceLoginForm"});exports.NiceAlert=V;exports.NiceCookieConsent=te;exports.NiceDrawer=W;exports.NiceErrorBoundary=z;exports.NiceLoginForm=re;exports.NiceOfflineBanner=ee;exports.NiceRetryPanel=ne;exports.NiceTimeoutFeedback=se;exports.NiceToastContainer=U;exports.alertIcons=q;exports.useNiceTimeout=B;exports.useNiceToast=G;