@nice2dev/ui 1.1.10 → 1.2.0
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/CHANGELOG.md +76 -0
- package/README.md +12 -20
- package/dist/NiceButton-5tWvfXKl.cjs +1 -0
- package/dist/NiceButton-DHSgQT1_.js +112 -0
- package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
- package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
- package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
- package/dist/NiceColorPicker-DK30kJgy.js +486 -0
- package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
- package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
- package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
- package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
- package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
- package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
- package/dist/NiceForm-BCEXovJR.cjs +1 -0
- package/dist/NiceForm-D7oyWHXg.js +4820 -0
- package/dist/NiceForm-DUhxXArr.js +4817 -0
- package/dist/NiceForm-uCeVmTrD.cjs +1 -0
- package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
- package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
- package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
- package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
- package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
- package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
- package/dist/NiceLoginForm.css +1 -0
- package/dist/NiceMention-CA7CL5BI.js +11263 -0
- package/dist/NiceMention-CHcKRl-L.cjs +430 -0
- package/dist/NiceMention-DJD0BLcp.js +11269 -0
- package/dist/NiceMention-DcaUEMSg.cjs +430 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-C4p8a82e.cjs +1 -0
- package/dist/NiceModal-TNlkaL_i.js +85 -0
- package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
- package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
- package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
- package/dist/NicePagination-8XsBbMNx.js +165 -0
- package/dist/NicePagination-CkOoXf0f.js +165 -0
- package/dist/NicePagination-D7lek1G7.cjs +1 -0
- package/dist/NicePagination-OjTEfZJE.cjs +1 -0
- package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
- package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
- package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
- package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
- package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
- package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
- package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
- package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
- package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
- package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
- package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
- package/dist/NiceSelect-DZB1Rs9x.js +435 -0
- package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
- package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
- package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
- package/dist/NiceWindow-BEov3s9F.js +2094 -0
- package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-C047IMVn.cjs +768 -0
- package/dist/charts-CCXSb3xk.js +4752 -0
- package/dist/charts-CqETcUhH.js +4752 -0
- package/dist/charts-DouiiHOT.cjs +768 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-BL-KmGYC.js +795 -0
- package/dist/core-Chg-oYCr.cjs +1 -0
- package/dist/core-CxBnKAhs.cjs +1 -0
- package/dist/core-D_LRh59n.js +795 -0
- package/dist/data-branching-Km4lc8P_.cjs +1 -0
- package/dist/data-branching-YQtJJEtn.js +6273 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +0 -51
- package/dist/data.mjs +3 -3
- package/dist/devops-D5yIDM3e.js +8312 -0
- package/dist/devops-rVpB0ZAX.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +6 -25
- package/dist/editors.mjs +55 -54
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.mjs +2 -2
- package/dist/index.cjs +284 -284
- package/dist/index.css +1 -1
- package/dist/index.d.ts +194 -208
- package/dist/index.mjs +20312 -19511
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +29 -29
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.mjs +3 -3
- package/dist/no-code-6WyYb3hL.cjs +331 -0
- package/dist/no-code-BH5oVFC6.js +8186 -0
- package/dist/no-code-CnHG5_Vn.js +8186 -0
- package/dist/no-code-DMKlg1Zl.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.css +1 -1
- package/dist/no-code.d.ts +25 -18
- package/dist/no-code.mjs +3 -3
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +24 -24
- package/dist/overlays.mjs +24 -490
- package/dist/pickerCommons-0vyK1Knv.js +547 -0
- package/dist/pickerCommons-BFbItm8o.cjs +1 -0
- package/dist/pickerCommons-BHirHJyn.js +548 -0
- package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +10 -7
- package/package.json +4 -6
- package/css/legacy-bg-text-aliases.css +0 -87
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),g=require("@nice2dev/ui-core"),n=require("react"),U=require("./NiceButton-5tWvfXKl.cjs"),M={info:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})}),success:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})}),warning:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),error:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z",clipRule:"evenodd"})})},W=({variant:s="info",title:i,children:a,closable:r,onClose:t,icon:c,size:d="md",className:f,style:u,displayStyle:h})=>{const _=g.useComponentDisplayClass("card",h);return e.jsxs("div",{className:`nice-alert nice-alert--${s} nice-alert--${d} nice-alert--ds-${_} ${f||""}`,style:u,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${s}`,children:c||M[s]}),e.jsxs("div",{className:"nice-alert__content",children:[i&&e.jsx("div",{className:"nice-alert__title",children:i}),e.jsx("div",{children:a})]}),r&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:t,"aria-label":"Close",children:e.jsx(g.NiceIcon,{name:"close",size:16})})]})},Y=({open:s,onClose:i,title:a,position:r="right",size:t="md",children:c,footer:d,transitionDuration:f,className:u,style:h,displayStyle:_})=>{const N=g.useComponentDisplayStyle("modal",_),x=g.useComponentDisplayClass("modal",_),{t:p}=g.useNiceTranslation(),j=n.useRef(null);return g.useFocusTrap(j,s),n.useEffect(()=>{if(!s)return;const m=o=>{o.key==="Escape"&&i()};return document.addEventListener("keydown",m),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}},[s,i]),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onMouseDown:m=>{m.target===m.currentTarget&&i()}}),e.jsxs("div",{ref:j,className:`nice-drawer nice-drawer--${r} nice-drawer--${t} nice-drawer--ds-${x} ${u||""}`,style:{...N,...h,...f!=null?{transitionDuration:`${f}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:i,"aria-label":p("controls.close","Close"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]}),e.jsx("div",{className:"nice-drawer__body",children:c}),d&&e.jsx("div",{className:"nice-drawer__footer",children:d})]})]}):null},G=({toasts:s,onDismiss:i,position:a="top-right"})=>e.jsx("div",{className:`nice-toast-container nice-toast-container--${a}`,children:s.map(r=>e.jsx(J,{toast:r,onDismiss:i},r.id))}),J=({toast:s,onDismiss:i})=>{const[a,r]=n.useState(!1);return n.useEffect(()=>{if(!s.duration&&s.duration!==0){const t=setTimeout(()=>r(!0),4e3);return()=>clearTimeout(t)}if(s.duration>0){const t=setTimeout(()=>r(!0),s.duration);return()=>clearTimeout(t)}},[s.duration]),n.useEffect(()=>{if(a){const t=setTimeout(()=>i(s.id),200);return()=>clearTimeout(t)}},[a,s.id,i]),e.jsxs("div",{className:`nice-toast nice-toast--${s.variant} ${a?"nice-toast--exiting":""}`,role:"alert",style:{position:"relative"},children:[e.jsx("div",{className:"nice-toast__icon",children:M[s.variant]}),e.jsxs("div",{className:"nice-toast__content",children:[s.title&&e.jsx("div",{className:"nice-toast__title",children:s.title}),e.jsx("div",{className:"nice-toast__message",children:s.message})]}),e.jsx("button",{type:"button",className:"nice-toast__close",onClick:()=>r(!0),"aria-label":"Close",children:e.jsx(g.NiceIcon,{name:"close",size:16})})]})};let K=0;function Q(){const[s,i]=n.useState([]),a=n.useCallback((t,c,d)=>{const f=`toast-${++K}`;return i(u=>[...u,{id:f,variant:t,message:c,title:d?.title,duration:d?.duration}]),f},[]),r=n.useCallback(t=>{i(c=>c.filter(d=>d.id!==t))},[]);return{toasts:s,dismiss:r,info:(t,c)=>a("info",t,c),success:(t,c)=>a("success",t,c),warning:(t,c)=>a("warning",t,c),error:(t,c)=>a("error",t,c)}}const P=class P extends n.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null},this.handleReset=()=>{this.setState({hasError:!1,error:null})}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,a){this.props.onError?.(i,a)}render(){if(this.state.hasError&&this.state.error){const{fallback:i,showRetry:a=!0,retryLabel:r="Retry",title:t="Something went wrong"}=this.props;return typeof i=="function"?i(this.state.error,this.handleReset):i||e.jsxs("div",{className:"nice-error-boundary",role:"alert",children:[e.jsx("div",{className:"nice-error-boundary__icon",children:e.jsx(g.NiceIcon,{name:"warning",size:32})}),e.jsx("h2",{className:"nice-error-boundary__title",children:t}),e.jsx("p",{className:"nice-error-boundary__message",children:this.state.error.message}),a&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:this.handleReset,children:r})]})}return this.props.children}};P.displayName="NiceErrorBoundary";let F=P;function X(s){return window.addEventListener("online",s),window.addEventListener("offline",s),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s)}}function Z(){return navigator.onLine}function ee(){return!0}const se=({message:s,variant:i="warning",icon:a,online:r,size:t="md",className:c,style:d,"data-testid":f})=>{const{t:u}=g.useNiceTranslation(),h=n.useSyncExternalStore(X,Z,ee);return r??h?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${i} nice-offline-banner--${t} ${c||""}`,style:d,role:"alert","aria-live":"assertive","data-testid":f,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:a??e.jsx(g.NiceIcon,{name:"wifi",size:18})}),e.jsx("span",{className:"nice-offline-banner__message",children:s??u("offlineBanner.message","You are offline. Some features may be unavailable.")})]})},ne=({error:s,onRetry:i,retryLabel:a="Retry",title:r="Operation failed",autoRetrySeconds:t,variant:c="error",icon:d,size:f="md",className:u,style:h,"data-testid":_})=>{const[N,x]=n.useState(t??0),p=n.useRef(void 0),j=typeof s=="string"?s:s.message,m=n.useCallback(()=>{x(t??0),i()},[i,t]);return n.useEffect(()=>{if(!(!t||t<=0))return x(t),p.current=setInterval(()=>{x(o=>o<=1?(clearInterval(p.current),i(),0):o-1)},1e3),()=>clearInterval(p.current)},[t,i]),e.jsxs("div",{className:`nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${f} ${u||""}`,style:h,role:"alert","data-testid":_,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:d??e.jsx(g.NiceIcon,{name:"warning",size:24})}),e.jsxs("div",{className:"nice-retry-panel__content",children:[e.jsx("div",{className:"nice-retry-panel__title",children:r}),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:m,children:a}),t&&N>0&&e.jsxs("span",{className:"nice-retry-panel__countdown",children:["Auto-retry in ",N,"s"]})]})]})};function q({timeoutMs:s=1e4,slowThresholdMs:i=3e3,onTimeout:a,autoRetry:r=!1,autoRetryCount:t=3}={}){const[c,d]=n.useState(!1),[f,u]=n.useState(!1),[h,_]=n.useState(!1),[N,x]=n.useState(0),[p,j]=n.useState(0),m=n.useRef(null),o=n.useRef(null),T=n.useRef(null),w=n.useRef(0),k=n.useCallback(()=>{m.current&&clearTimeout(m.current),o.current&&clearTimeout(o.current),T.current&&clearInterval(T.current)},[]),y=n.useCallback(()=>{k(),d(!0),u(!1),_(!1),x(0),w.current=Date.now(),T.current=setInterval(()=>{x(Date.now()-w.current)},200),m.current=setTimeout(()=>{u(!0)},i),o.current=setTimeout(()=>{_(!0),d(!1),u(!1),k(),a?.()},s)},[k,i,s,a]),C=n.useCallback(()=>{k(),d(!1),u(!1)},[k]),l=n.useCallback(()=>{j(v=>v+1),_(!1),y()},[y]);return n.useEffect(()=>()=>k(),[k]),n.useEffect(()=>{if(r&&h&&p<t){const v=Math.pow(2,p)*1e3,I=setTimeout(()=>l(),v);return()=>clearTimeout(I)}},[r,t,h,p,l]),{isLoading:c,isSlow:f,isTimedOut:h,elapsed:N,retryCount:p,start:y,stop:C,retry:l}}const te=({timeoutMs:s=1e4,slowThresholdMs:i=3e3,onTimeout:a,onRetry:r,autoRetry:t=!1,autoRetryCount:c=3,showProgress:d=!0,slowMessage:f,timeoutMessage:u,loading:h,children:_,size:N="md",className:x,style:p,"data-testid":j})=>{const{t:m}=g.useNiceTranslation(),{isSlow:o,isTimedOut:T,elapsed:w,start:k,stop:y,retry:C}=q({timeoutMs:s,slowThresholdMs:i,onTimeout:a,autoRetry:t,autoRetryCount:c}),l=n.useRef(k);l.current=k;const v=n.useRef(y);v.current=y,n.useEffect(()=>{h?l.current():v.current()},[h]);const I=()=>{C(),r?.()};if(!h)return e.jsx(e.Fragment,{children:_});if(T)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${N} ${x??""}`,style:p,role:"alert","data-testid":j,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:u??m("timeoutFeedback.timeout","The operation timed out. Please try again.")}),e.jsx(U.NiceButton,{size:"sm",className:"nice-timeout-feedback__retry-btn",onClick:I,children:m("timeoutFeedback.retry","Try again")})]});const $=Math.min(100,w/s*100);return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--${N} ${o?"nice-timeout-feedback--slow":""} ${x??""}`,style:p,role:"status","aria-busy":"true","data-testid":j,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-hidden":"true"}),o&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:f??m("timeoutFeedback.slow","This is taking longer than usual…")}),d&&e.jsx("div",{className:"nice-timeout-feedback__progress",role:"progressbar","aria-label":m("timeoutFeedback.progress","Time until timeout"),"aria-valuenow":Math.round($),"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"nice-timeout-feedback__progress-bar",style:{width:`${$}%`}})})]})},O=n.forwardRef(({visible:s,onAcceptAll:i,onRejectAll:a,onSave:r,categories:t=["necessary","analytics","marketing","preferences"],defaults:c,position:d="bottom",size:f="md",policyUrl:u,showDetails:h=!1,className:_,style:N,id:x,...p},j)=>{const m=g.useControlId(x),{t:o}=g.useNiceTranslation(),[T,w]=n.useState(!0),k=s??T,[y,C]=n.useState(h),[l,v]=n.useState(()=>{const b={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return c&&Object.assign(b,c),b.necessary=!0,b}),I={necessary:o("cookie.necessary","Necessary"),analytics:o("cookie.analytics","Analytics"),marketing:o("cookie.marketing","Marketing"),preferences:o("cookie.preferences","Preferences")},$={necessary:o("cookie.necessaryDesc","Required for the website to function. Cannot be disabled."),analytics:o("cookie.analyticsDesc","Help us understand how visitors interact with the website."),marketing:o("cookie.marketingDesc","Used to deliver relevant advertisements."),preferences:o("cookie.preferencesDesc","Allow the website to remember your choices.")},L=n.useCallback(()=>{const b={necessary:!0,analytics:!0,marketing:!0,preferences:!0};i?.(),r?.(b),w(!1)},[i,r]),S=n.useCallback(()=>{const b={necessary:!0,analytics:!1,marketing:!1,preferences:!1};a?.(),r?.(b),w(!1)},[a,r]),z=n.useCallback(()=>{r?.({...l,necessary:!0}),w(!1)},[l,r]);return k?e.jsx("div",{ref:j,id:m,className:`nice-cookie-consent nice-cookie-consent--${d} nice-cookie-consent--${f} ${_??""}`,style:N,role:"dialog","aria-label":o("cookie.label","Cookie Consent"),"aria-modal":"true",...p,children:e.jsxs("div",{className:"nice-cookie-consent__content",children:[e.jsxs("p",{className:"nice-cookie-consent__message",children:[o("cookie.message","We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."),u&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:u,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:o("cookie.learnMore","Learn more")})]})]}),y&&e.jsx("div",{className:"nice-cookie-consent__details",children:t.map(b=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:l[b],disabled:b==="necessary",onChange:D=>v(E=>({...E,[b]:D.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:I[b]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:$[b]})]})]},b))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!y&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>C(!0),children:o("cookie.customize","Customize")}),y&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--save",onClick:z,children:o("cookie.savePreferences","Save preferences")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--reject",onClick:S,children:o("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:L,children:o("cookie.acceptAll","Accept all")})]})]})}):null});O.displayName="NiceCookieConsent";const H=n.forwardRef(({onSubmit:s,onForgotPassword:i,onRegister:a,loading:r=!1,error:t,variant:c="primary",size:d="md",showRememberMe:f=!0,showForgotPassword:u=!0,showRegister:h=!1,title:_,logo:N,usernameLabel:x,passwordLabel:p,usernamePlaceholder:j,passwordPlaceholder:m,className:o,style:T,id:w,...k},y)=>{const C=g.useControlId(w),{t:l}=g.useNiceTranslation(),[v,I]=n.useState(""),[$,L]=n.useState(""),[S,z]=n.useState(!1),[b,D]=n.useState(!1),E=`${C}-user`,A=`${C}-pass`,B=`${C}-remember`,V=n.useCallback(R=>{R.preventDefault(),!r&&s?.({username:v,password:$,rememberMe:S})},[r,v,$,S,s]);return e.jsxs("form",{ref:y,id:C,className:`nice-login nice-login--${c} nice-login--${d} ${o??""}`,style:T,onSubmit:V,noValidate:!0,...k,children:[N&&e.jsx("div",{className:"nice-login__logo",children:N}),_&&e.jsx("h2",{className:"nice-login__title",children:_??l("login.title","Sign In")}),t&&e.jsx("div",{className:"nice-login__error",role:"alert",children:t}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:E,className:"nice-login__label",children:x??l("login.username","Username")}),e.jsx("input",{id:E,className:"nice-login__input",type:"text",value:v,onChange:R=>I(R.target.value),placeholder:j??l("login.usernamePlaceholder","Enter your username"),autoComplete:"username",required:!0,disabled:r,"aria-required":"true"})]}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:A,className:"nice-login__label",children:p??l("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:A,className:"nice-login__input",type:b?"text":"password",value:$,onChange:R=>L(R.target.value),placeholder:m??l("login.passwordPlaceholder","Enter your password"),autoComplete:"current-password",required:!0,disabled:r,"aria-required":"true"}),e.jsx("button",{type:"button",className:"nice-login__toggle-password",onClick:()=>D(!b),"aria-label":b?l("login.hidePassword","Hide password"):l("login.showPassword","Show password"),tabIndex:-1,children:e.jsx(g.NiceIcon,{name:b?"eye-off":"eye",size:16})})]})]}),e.jsxs("div",{className:"nice-login__options",children:[f&&e.jsxs("label",{className:"nice-login__remember",htmlFor:B,children:[e.jsx("input",{id:B,type:"checkbox",checked:S,onChange:R=>z(R.target.checked),disabled:r}),e.jsx("span",{children:l("login.rememberMe","Remember me")})]}),u&&i&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:i,disabled:r,children:l("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${c}`,disabled:r||!v||!$,children:r?l("login.loading","Signing in..."):l("login.submit","Sign In")}),h&&a&&e.jsxs("p",{className:"nice-login__register",children:[l("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:a,disabled:r,children:l("login.register","Register")})]})]})});H.displayName="NiceLoginForm";exports.NiceAlert=W;exports.NiceCookieConsent=O;exports.NiceDrawer=Y;exports.NiceErrorBoundary=F;exports.NiceLoginForm=H;exports.NiceOfflineBanner=se;exports.NiceRetryPanel=ne;exports.NiceTimeoutFeedback=te;exports.NiceToastContainer=G;exports.alertIcons=M;exports.useNiceTimeout=q;exports.useNiceToast=Q;
|