@nice2dev/ui 1.2.0 → 1.2.2
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 +150 -0
- package/dist/NiceApiExplorer.doc-CFJndg5h.js +25 -0
- package/dist/NiceApiExplorer.doc-TEx67kV5.cjs +1 -0
- package/dist/NiceBPMNDesigner.doc-6lK1pXRq.js +32 -0
- package/dist/NiceBPMNDesigner.doc-BY8t7qOi.cjs +8 -0
- package/dist/NiceBackupDiffViewer.doc-CYvOeX19.js +25 -0
- package/dist/NiceBackupDiffViewer.doc-ChQaZCg1.cjs +1 -0
- package/dist/NiceBackupList.doc-BdQCw0_D.cjs +1 -0
- package/dist/NiceBackupList.doc-BwjIAoqz.js +25 -0
- package/dist/NiceBackupRestoreDialog.doc-B2iiqTps.cjs +1 -0
- package/dist/NiceBackupRestoreDialog.doc-DuXSGJiD.js +25 -0
- package/dist/NiceBackupScheduler.doc-BpY45181.js +31 -0
- package/dist/NiceBackupScheduler.doc-ByeL3iH1.cjs +7 -0
- package/dist/NiceBackupStatusBadge.doc-BA3dYgiW.cjs +1 -0
- package/dist/NiceBackupStatusBadge.doc-CxwkVarP.js +25 -0
- package/dist/NiceBackupTagEditor.doc-Bej1KHco.cjs +7 -0
- package/dist/NiceBackupTagEditor.doc-CNy4uNws.js +31 -0
- package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +8 -0
- package/dist/NiceBottomSheet.doc-v-UPUKQk.js +32 -0
- package/dist/NiceBranchManager.doc-BTyRjX7X.cjs +6 -0
- package/dist/NiceBranchManager.doc-Cz4SyEqE.js +30 -0
- package/dist/NiceButton-3AcJJ15c.cjs +1 -0
- package/dist/NiceButton-vkI07DP0.js +88 -0
- package/dist/NiceCodeEditor-C43xFG8v.cjs +260 -0
- package/dist/NiceCodeEditor-CspuYLh6.js +1174 -0
- package/dist/NiceCodeEditor-VGIDWSkS.js +1181 -0
- package/dist/NiceCodeEditor-qX39PSnQ.cjs +260 -0
- package/dist/NiceColorPicker-CQhhjZ8w.cjs +1 -0
- package/dist/NiceColorPicker-Cbop7VMu.js +491 -0
- package/dist/NiceConnectorConfigForm.doc-BKrDuhXw.cjs +7 -0
- package/dist/NiceConnectorConfigForm.doc-BsHeXz3M.js +31 -0
- package/dist/NiceDataBranchGraph.doc-Axidz41W.js +29 -0
- package/dist/NiceDataBranchGraph.doc-sjLmrrtE.cjs +5 -0
- package/dist/NiceDataBranchManager.doc-B1-Rp2X4.cjs +6 -0
- package/dist/NiceDataBranchManager.doc-GUqfTFvW.js +30 -0
- package/dist/NiceDataConflictResolver.doc-CjQryrTu.cjs +5 -0
- package/dist/NiceDataConflictResolver.doc-L-TcnQMX.js +29 -0
- package/dist/NiceDataDiffViewer.doc-BzGrf0U-.cjs +6 -0
- package/dist/NiceDataDiffViewer.doc-goxhSldH.js +30 -0
- package/dist/NiceDataGrid-BDEIbuBS.js +2218 -0
- package/dist/NiceDataGrid-CS5aB-EN.cjs +10 -0
- package/dist/NiceDataGrid-CrD4HPlO.cjs +10 -0
- package/dist/NiceDataGrid-Dfg1DVbU.js +2224 -0
- package/dist/NiceDataMapper.doc-QmnmnvVq.js +30 -0
- package/dist/NiceDataMapper.doc-ytGVtYVr.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-BcmzKxh2.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-BvYa4aUJ.js +30 -0
- package/dist/NiceDataSnapshot.doc-C73K1biG.cjs +6 -0
- package/dist/NiceDataSnapshot.doc-hU7wnOzM.js +30 -0
- package/dist/NiceDesktopViews.doc-DJjYlyP2.cjs +1 -0
- package/dist/NiceDesktopViews.doc-ly-VUAJj.js +25 -0
- package/dist/NiceDeviceControlCard.doc-BZIo92-w.cjs +1 -0
- package/dist/NiceDeviceControlCard.doc-DIzZcW9L.js +25 -0
- package/dist/NiceDocumentViewer-B9VIVKyw.js +726 -0
- package/dist/NiceDocumentViewer-CDXAmPp7.cjs +180 -0
- package/dist/NiceDocumentationViewer.doc-BSNGa7a_.js +25 -0
- package/dist/NiceDocumentationViewer.doc-CrwlvPFg.cjs +1 -0
- package/dist/NiceEnergyChart.doc-DW-jllDV.cjs +1 -0
- package/dist/NiceEnergyChart.doc-DnEehTff.js +25 -0
- package/dist/NiceFeatureGate.doc-DN17uS_B.cjs +3 -0
- package/dist/NiceFeatureGate.doc-DNfFSRrh.js +27 -0
- package/dist/NiceForm-BcN4p2kG.cjs +1 -0
- package/dist/NiceForm-CISJyzoW.cjs +1 -0
- package/dist/NiceForm-DmH6k1b_.js +4775 -0
- package/dist/NiceForm-tIXS-M6b.js +4770 -0
- package/dist/NiceFormItem.doc-BJwEnDz2.js +36 -0
- package/dist/NiceFormItem.doc-Ck3PgaPD.cjs +12 -0
- package/dist/NiceGantt-CHnq-n8f.cjs +1 -0
- package/dist/NiceGantt-CTbqCuwv.cjs +1 -0
- package/dist/NiceGantt-CX3jVNaF.js +330 -0
- package/dist/NiceGantt-Dao7pN9z.js +328 -0
- package/dist/NiceGantt.doc-B6YZcJvG.cjs +11 -0
- package/dist/NiceGantt.doc-DsI1QXly.js +48 -0
- package/dist/NiceGitBlame.doc-BQ2KvGkD.js +30 -0
- package/dist/NiceGitBlame.doc-DuTSjZVN.cjs +6 -0
- package/dist/NiceGitDiffViewer.doc-D24AGos_.js +30 -0
- package/dist/NiceGitDiffViewer.doc-D9FVquBC.cjs +6 -0
- package/dist/NiceGitGraph.doc-C-8VGMIz.js +29 -0
- package/dist/NiceGitGraph.doc-eRvTmefl.cjs +5 -0
- package/dist/NiceGitHooks.doc-DCTVw7HX.cjs +5 -0
- package/dist/NiceGitHooks.doc-OCFj5w6v.js +29 -0
- package/dist/NiceHtmlEditor-DUwcqj5N.cjs +10 -0
- package/dist/NiceHtmlEditor-DeK0Of98.js +883 -0
- package/dist/NiceHtmlEditor-DiAphF1k.js +889 -0
- package/dist/NiceHtmlEditor-DvVxl4Fu.cjs +10 -0
- package/dist/NiceInstanceMonitor.doc-BSDZp5xa.js +31 -0
- package/dist/NiceInstanceMonitor.doc-HVbLufnh.cjs +7 -0
- package/dist/NiceLocaleManager.doc-CbVHDEWu.js +25 -0
- package/dist/NiceLocaleManager.doc-XH6hMW0Z.cjs +1 -0
- package/dist/NiceLockButton.doc-BMhSj3TB.cjs +1 -0
- package/dist/NiceLockButton.doc-DvHGhcfm.js +25 -0
- package/dist/NiceLoginForm-CHXbz0eu.js +747 -0
- package/dist/NiceLoginForm-DQe77Isv.js +747 -0
- package/dist/NiceLoginForm-NBCo-DUZ.cjs +1 -0
- package/dist/NiceLoginForm-ix6J1adA.cjs +1 -0
- package/dist/NiceLoginForm.css +1 -1
- package/dist/NiceMAM.doc-CsQ57saR.cjs +8 -0
- package/dist/NiceMAM.doc-hjW7buTH.js +32 -0
- package/dist/NiceMention--3P3vO-W.cjs +430 -0
- package/dist/NiceMention-Co2cqkVM.js +11316 -0
- package/dist/NiceMention-DKhk3xdM.js +11321 -0
- package/dist/NiceMention-wp1AJ5oh.cjs +430 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-BbQwiEOp.cjs +1 -0
- package/dist/NiceModal-DQEfTcnZ.js +85 -0
- package/dist/NiceModuleLifecyclePanel-22CEEVbA.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BCd9Wv5Y.js +6825 -0
- package/dist/NiceModuleLifecyclePanel-DV3F_QdI.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-gaZkIEtK.js +6825 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NiceNetworkDiscoveryPanel.doc-B0RtGaS3.js +25 -0
- package/dist/NiceNetworkDiscoveryPanel.doc-BFgFZI5G.cjs +1 -0
- package/dist/NicePagination-B3nZDZem.js +165 -0
- package/dist/NicePagination-B8rg1Y67.cjs +1 -0
- package/dist/NicePagination-BFGt1v0a.js +165 -0
- package/dist/NicePagination-DltL3-Sz.cjs +1 -0
- package/dist/NicePipelineEditor.doc-CjqDKe2x.js +29 -0
- package/dist/NicePipelineEditor.doc-DZ0pTVTp.cjs +5 -0
- package/dist/NicePipelineMonitor.doc-C88-TagI.cjs +5 -0
- package/dist/NicePipelineMonitor.doc-CFtH4XJx.js +29 -0
- package/dist/NicePivotGrid-BD87Na7P.js +1163 -0
- package/dist/NicePivotGrid-BPmnvbPQ.cjs +152 -0
- package/dist/NicePivotGrid-BaZa2YZW.js +1157 -0
- package/dist/NicePivotGrid-DyOPhPO8.cjs +152 -0
- package/dist/NiceRoomGrid.doc-DJPVUQVg.cjs +8 -0
- package/dist/NiceRoomGrid.doc-DLHJS_Wb.js +32 -0
- package/dist/NiceSavedQueryPanel-BC84uRfh.cjs +586 -0
- package/dist/NiceSavedQueryPanel-BSTiZvFg.js +5130 -0
- package/dist/NiceSavedQueryPanel-CMfcODIO.js +5120 -0
- package/dist/NiceSavedQueryPanel-DrR3sw4T.cjs +586 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceSceneBar.doc-09sc3yuF.cjs +1 -0
- package/dist/NiceSceneBar.doc-DLePMuVU.js +25 -0
- package/dist/NiceSceneSelector.doc-CPzCAy-d.cjs +7 -0
- package/dist/NiceSceneSelector.doc-FCLZvPc0.js +31 -0
- package/dist/NiceScheduler-BAJRzFQN.js +1690 -0
- package/dist/NiceScheduler-DvxJ8N0I.js +1698 -0
- package/dist/NiceScheduler-TIksdF0k.cjs +5 -0
- package/dist/NiceScheduler-dJ7gHDv7.cjs +5 -0
- package/dist/NiceSchedulerViews.doc-C9opZpgg.cjs +1 -0
- package/dist/NiceSchedulerViews.doc-Dy7ZH1iL.js +25 -0
- package/dist/NiceSelect-CZR8Zu_k.js +420 -0
- package/dist/NiceSelect-DIKGbaJo.cjs +1 -0
- package/dist/NiceSensorGaugePanel.doc-BHirbWLn.cjs +8 -0
- package/dist/NiceSensorGaugePanel.doc-DjKmooI6.js +32 -0
- package/dist/NiceSpotlight.doc-BVZFfDVI.cjs +10 -0
- package/dist/NiceSpotlight.doc-JqwkzrEm.js +34 -0
- package/dist/NiceStateDesigner.doc-CfnwiwfU.js +29 -0
- package/dist/NiceStateDesigner.doc-DV4zEC50.cjs +5 -0
- package/dist/NiceStepper.doc-5VjaLM6r.js +31 -0
- package/dist/NiceStepper.doc-f8lYpr33.cjs +7 -0
- package/dist/NiceTaskInbox.doc-CHrxthqp.js +32 -0
- package/dist/NiceTaskInbox.doc-CdCTfgBq.cjs +8 -0
- package/dist/NiceTestBuilder.doc-BoBzLfa0.js +30 -0
- package/dist/NiceTestBuilder.doc-Cj1fNTvk.cjs +6 -0
- package/dist/NiceTranscoder.doc-Dnirl3wg.cjs +7 -0
- package/dist/NiceTranscoder.doc-cInCYZh7.js +31 -0
- package/dist/NiceVideoAnnotator.doc-C1iEi7OM.cjs +7 -0
- package/dist/NiceVideoAnnotator.doc-C8zyfKH_.js +31 -0
- package/dist/NiceVideoEditor.doc-C6mhEb-q.cjs +7 -0
- package/dist/NiceVideoEditor.doc-lrwmKjqj.js +31 -0
- package/dist/NiceWindow-CWN8OCHF.js +2109 -0
- package/dist/NiceWindow-Dd8qjkIW.cjs +1 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-Bo2WAI5T.cjs +768 -0
- package/dist/charts-BpELGDXh.cjs +768 -0
- package/dist/charts-ByrdMeQP.js +4767 -0
- package/dist/charts-M6LuVI7F.js +4776 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.d.ts +28 -46
- package/dist/charts.mjs +1 -1
- package/dist/core-B8eBUE4m.js +438 -0
- package/dist/core-lBFqvT0V.cjs +1 -0
- package/dist/core-lazy-Bh2yg4Et.js +351 -0
- package/dist/core-lazy-CkWKjfc6.cjs +1 -0
- package/dist/core-lazy-Ctin_LwS.cjs +1 -0
- package/dist/core-lazy-iDiropM6.js +351 -0
- package/dist/data-branching-BgIAw01q.cjs +1 -0
- package/dist/data-branching-Dak1_ZKR.cjs +1 -0
- package/dist/data-branching-DiLAO4Qt.js +6386 -0
- package/dist/data-branching-bvB9K6KS.js +6386 -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 +22 -18
- package/dist/data.mjs +3 -3
- package/dist/devops-Bp-_aA-9.js +8682 -0
- package/dist/devops-CXBSjnyX.cjs +17 -0
- package/dist/devops-DkVluHBp.cjs +17 -0
- package/dist/devops-zsMUueTd.js +8648 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +3 -3
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +100 -38
- package/dist/editors.mjs +8 -8
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +71 -2
- package/dist/feedback.mjs +10 -9
- package/dist/index.cjs +263 -263
- package/dist/index.css +1 -1
- package/dist/index.d.ts +641 -253
- package/dist/index.mjs +26438 -26260
- package/dist/injectStyleOnce-BzC_BCs_.js +9 -0
- package/dist/injectStyleOnce-DeWaxcdf.cjs +1 -0
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +9 -7
- package/dist/lazy.mjs +51 -51
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.css +1 -0
- package/dist/navigation.d.ts +99 -43
- package/dist/navigation.mjs +504 -547
- package/dist/no-code-BNFk_BDO.js +8275 -0
- package/dist/no-code-CFdTp543.cjs +331 -0
- package/dist/no-code-DiTEnuRv.js +8288 -0
- package/dist/no-code-wG9c0z_T.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.css +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +12 -6
- package/dist/overlays.mjs +1 -1
- package/dist/pickerCommons-BCRiHDE_.cjs +1 -0
- package/dist/pickerCommons-CMxFt9SW.js +548 -0
- package/dist/pickerCommons-Dc_hlz-e.cjs +1 -0
- package/dist/pickerCommons-DkumQ3KE.js +548 -0
- package/dist/style.css +12 -9
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("@nice2dev/ui-core"),n=require("react"),V=require("./NiceButton-3AcJJ15c.cjs"),z={info:e.jsx(l.NiceIcon,{name:"info",size:20}),success:e.jsx(l.NiceIcon,{name:"success",size:20}),warning:e.jsx(l.NiceIcon,{name:"warning",size:20}),error:e.jsx(l.NiceIcon,{name:"error",size:20})},W=({variant:s="info",title:t,children:a,closable:r,onClose:i,icon:c,size:d="md",className:h,style:f,displayStyle:b})=>{const{t:N}=l.useNiceTranslation(),p=l.useComponentDisplayClass("card",b);return e.jsxs("div",{className:`nice-alert nice-alert--${s} nice-alert--${d} nice-alert--ds-${p} ${h||""}`,style:f,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${s}`,children:c||z[s]}),e.jsxs("div",{className:"nice-alert__content",children:[t&&e.jsx("div",{className:"nice-alert__title",children:t}),e.jsx("div",{children:a})]}),r&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:i,"aria-label":N("alert.close","Close"),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]})},H=({open:s,onClose:t,title:a,position:r="right",size:i="md",children:c,footer:d,transitionDuration:h,className:f,style:b,displayStyle:N})=>{const p=l.useComponentDisplayStyle("modal",N),j=l.useComponentDisplayClass("modal",N),{t:g}=l.useNiceTranslation(),x=n.useRef(null);return l.useFocusTrap(x,s),n.useEffect(()=>{if(!s)return;const m=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",m),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}},[s,t]),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onMouseDown:m=>{m.target===m.currentTarget&&t()}}),e.jsxs("div",{ref:x,className:`nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${j} ${f||""}`,style:{...p,...b,...h!=null?{transitionDuration:`${h}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:t,"aria-label":g("controls.close","Close"),children:e.jsx(l.NiceIcon,{name:"close",size:18})})]}),e.jsx("div",{className:"nice-drawer__body",children:c}),d&&e.jsx("div",{className:"nice-drawer__footer",children:d})]})]}):null},U=({toasts:s,onDismiss:t,position:a="top-right"})=>e.jsx("div",{className:`nice-toast-container nice-toast-container--${a}`,children:s.map(r=>e.jsx(Y,{toast:r,onDismiss:t},r.id))}),Y=({toast:s,onDismiss:t})=>{const{t:a}=l.useNiceTranslation(),[r,i]=n.useState(!1);return n.useEffect(()=>{if(!s.duration&&s.duration!==0){const c=setTimeout(()=>i(!0),4e3);return()=>clearTimeout(c)}if(s.duration>0){const c=setTimeout(()=>i(!0),s.duration);return()=>clearTimeout(c)}},[s.duration]),n.useEffect(()=>{if(r){const c=setTimeout(()=>t(s.id),200);return()=>clearTimeout(c)}},[r,s.id,t]),e.jsxs("div",{className:`nice-toast nice-toast--${s.variant} ${r?"nice-toast--exiting":""}`,role:"alert",style:{position:"relative"},children:[e.jsx("div",{className:"nice-toast__icon",children:z[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:()=>i(!0),"aria-label":a("toast.close","Close"),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]})};let G=0;function J(){const[s,t]=n.useState([]),a=n.useCallback((i,c,d)=>{const h=`toast-${++G}`;return t(f=>[...f,{id:h,variant:i,message:c,title:d?.title,duration:d?.duration}]),h},[]),r=n.useCallback(i=>{t(c=>c.filter(d=>d.id!==i))},[]);return{toasts:s,dismiss:r,info:(i,c)=>a("info",i,c),success:(i,c)=>a("success",i,c),warning:(i,c)=>a("warning",i,c),error:(i,c)=>a("error",i,c)}}function K({error:s,showRetry:t,retryLabel:a,title:r,onReset:i}){const{t:c}=l.useNiceTranslation();return e.jsxs("div",{className:"nice-error-boundary",role:"alert",children:[e.jsx("div",{className:"nice-error-boundary__icon",children:e.jsx(l.NiceIcon,{name:"warning",size:32})}),e.jsx("h2",{className:"nice-error-boundary__title",children:r??c("errorBoundary.somethingWentWrong","Something went wrong")}),e.jsx("p",{className:"nice-error-boundary__message",children:s.message}),t&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:i,children:a??c("errorBoundary.retry","Retry")})]})}const O=class O extends n.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null},this.handleReset=()=>{this.setState({hasError:!1,error:null})}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,a){this.props.onError?.(t,a)}render(){if(this.state.hasError&&this.state.error){const{fallback:t,showRetry:a=!0,retryLabel:r,title:i}=this.props;return typeof t=="function"?t(this.state.error,this.handleReset):t||e.jsx(K,{error:this.state.error,showRetry:a,retryLabel:r,title:i,onReset:this.handleReset})}return this.props.children}};O.displayName="NiceErrorBoundary";let L=O;function Q(s){return window.addEventListener("online",s),window.addEventListener("offline",s),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s)}}function X(){return navigator.onLine}function Z(){return!0}const ee=({message:s,variant:t="warning",icon:a,online:r,size:i="md",className:c,style:d,"data-testid":h})=>{const{t:f}=l.useNiceTranslation(),b=n.useSyncExternalStore(Q,X,Z);return r??b?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${i} ${c||""}`,style:d,role:"alert","aria-live":"assertive","data-testid":h,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:a??e.jsx(l.NiceIcon,{name:"wifi",size:18})}),e.jsx("span",{className:"nice-offline-banner__message",children:s??f("offlineBanner.message","You are offline. Some features may be unavailable.")})]})},se=({error:s,onRetry:t,retryLabel:a="Retry",title:r,autoRetrySeconds:i,variant:c="error",icon:d,size:h="md",className:f,style:b,"data-testid":N})=>{const{t:p}=l.useNiceTranslation(),j=r??p("retryPanel.operationFailed","Operation failed"),[g,x]=n.useState(i??0),m=n.useRef(void 0),o=typeof s=="string"?s:s.message,C=n.useCallback(()=>{x(i??0),t()},[t,i]);return n.useEffect(()=>{if(!(!i||i<=0))return x(i),m.current=setInterval(()=>{x(y=>y<=1?(clearInterval(m.current),t(),0):y-1)},1e3),()=>clearInterval(m.current)},[i,t]),e.jsxs("div",{className:`nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${h} ${f||""}`,style:b,role:"alert","data-testid":N,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:d??e.jsx(l.NiceIcon,{name:"warning",size:24})}),e.jsxs("div",{className:"nice-retry-panel__content",children:[e.jsx("div",{className:"nice-retry-panel__title",children:j}),e.jsx("p",{className:"nice-retry-panel__message",children:o})]}),e.jsxs("div",{className:"nice-retry-panel__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:C,children:a}),i&&g>0&&e.jsx("span",{className:"nice-retry-panel__countdown",children:p("retryPanel.autoRetryInS","Auto-retry in {countdown}s").replace("{countdown}",String(g))})]})]})};function B({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:a,autoRetry:r=!1,autoRetryCount:i=3}={}){const[c,d]=n.useState(!1),[h,f]=n.useState(!1),[b,N]=n.useState(!1),[p,j]=n.useState(0),[g,x]=n.useState(0),m=n.useRef(null),o=n.useRef(null),C=n.useRef(null),y=n.useRef(0),k=n.useCallback(()=>{m.current&&clearTimeout(m.current),o.current&&clearTimeout(o.current),C.current&&clearInterval(C.current)},[]),v=n.useCallback(()=>{k(),d(!0),f(!1),N(!1),j(0),y.current=Date.now(),C.current=setInterval(()=>{j(Date.now()-y.current)},200),m.current=setTimeout(()=>{f(!0)},t),o.current=setTimeout(()=>{N(!0),d(!1),f(!1),k(),a?.()},s)},[k,t,s,a]),T=n.useCallback(()=>{k(),d(!1),f(!1)},[k]),u=n.useCallback(()=>{x(w=>w+1),N(!1),v()},[v]);return n.useEffect(()=>()=>k(),[k]),n.useEffect(()=>{if(r&&b&&g<i){const w=Math.pow(2,g)*1e3,I=setTimeout(()=>u(),w);return()=>clearTimeout(I)}},[r,i,b,g,u]),{isLoading:c,isSlow:h,isTimedOut:b,elapsed:p,retryCount:g,start:v,stop:T,retry:u}}const ne=({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:a,onRetry:r,autoRetry:i=!1,autoRetryCount:c=3,showProgress:d=!0,slowMessage:h,timeoutMessage:f,loading:b,children:N,size:p="md",className:j,style:g,"data-testid":x})=>{const{t:m}=l.useNiceTranslation(),{isSlow:o,isTimedOut:C,elapsed:y,start:k,stop:v,retry:T}=B({timeoutMs:s,slowThresholdMs:t,onTimeout:a,autoRetry:i,autoRetryCount:c}),u=n.useRef(k);u.current=k;const w=n.useRef(v);w.current=v,n.useEffect(()=>{b?u.current():w.current()},[b]);const I=()=>{T(),r?.()};if(!b)return e.jsx(e.Fragment,{children:N});if(C)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${p} ${j??""}`,style:g,role:"alert","data-testid":x,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:f??m("timeoutFeedback.timeout","The operation timed out. Please try again.")}),e.jsx(V.NiceButton,{size:"sm",className:"nice-timeout-feedback__retry-btn",onClick:I,children:m("timeoutFeedback.retry","Try again")})]});const $=Math.min(100,y/s*100);return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--${p} ${o?"nice-timeout-feedback--slow":""} ${j??""}`,style:g,role:"status","aria-busy":"true","data-testid":x,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-hidden":"true"}),o&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:h??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:`${$}%`}})})]})},te=Object.assign(n.forwardRef(({visible:s,onAcceptAll:t,onRejectAll:a,onSave:r,categories:i=["necessary","analytics","marketing","preferences"],defaults:c,position:d="bottom",size:h="md",policyUrl:f,showDetails:b=!1,className:N,style:p,id:j,...g},x)=>{const m=l.useControlId(j),{t:o}=l.useNiceTranslation(),[C,y]=n.useState(!0),k=s??C,[v,T]=n.useState(b),[u,w]=n.useState(()=>{const _={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return c&&Object.assign(_,c),_.necessary=!0,_}),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.")},D=n.useCallback(()=>{const _={necessary:!0,analytics:!0,marketing:!0,preferences:!0};t?.(),r?.(_),y(!1)},[t,r]),E=n.useCallback(()=>{const _={necessary:!0,analytics:!1,marketing:!1,preferences:!1};a?.(),r?.(_),y(!1)},[a,r]),F=n.useCallback(()=>{r?.({...u,necessary:!0}),y(!1)},[u,r]);return k?e.jsx("div",{ref:x,id:m,className:`nice-cookie-consent nice-cookie-consent--${d} nice-cookie-consent--${h} ${N??""}`,style:p,role:"dialog","aria-label":o("cookie.label","Cookie Consent"),"aria-modal":"true",...g,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."),f&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:f,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:o("cookie.learnMore","Learn more")})]})]}),v&&e.jsx("div",{className:"nice-cookie-consent__details",children:i.map(_=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:u[_],disabled:_==="necessary",onChange:P=>w(R=>({...R,[_]:P.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:I[_]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:$[_]})]})]},_))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!v&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>T(!0),children:o("cookie.customize","Customize")}),v&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--save",onClick:F,children:o("cookie.savePreferences","Save preferences")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--reject",onClick:E,children:o("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:D,children:o("cookie.acceptAll","Accept all")})]})]})}):null}),{displayName:"NiceCookieConsent"}),ie=Object.assign(n.forwardRef(({onSubmit:s,onForgotPassword:t,onRegister:a,loading:r=!1,error:i,variant:c="primary",size:d="md",showRememberMe:h=!0,showForgotPassword:f=!0,showRegister:b=!1,title:N,logo:p,usernameLabel:j,passwordLabel:g,usernamePlaceholder:x,passwordPlaceholder:m,className:o,style:C,id:y,...k},v)=>{const T=l.useControlId(y),{t:u}=l.useNiceTranslation(),[w,I]=n.useState(""),[$,D]=n.useState(""),[E,F]=n.useState(!1),[_,P]=n.useState(!1),R=`${T}-user`,q=`${T}-pass`,A=`${T}-remember`,M=n.useCallback(S=>{S.preventDefault(),!r&&s?.({username:w,password:$,rememberMe:E})},[r,w,$,E,s]);return e.jsxs("form",{ref:v,id:T,className:`nice-login nice-login--${c} nice-login--${d} ${o??""}`,style:C,onSubmit:M,noValidate:!0,...k,children:[p&&e.jsx("div",{className:"nice-login__logo",children:p}),N&&e.jsx("h2",{className:"nice-login__title",children:N??u("login.title","Sign In")}),i&&e.jsx("div",{className:"nice-login__error",role:"alert",children:i}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:R,className:"nice-login__label",children:j??u("login.username","Username")}),e.jsx("input",{id:R,className:"nice-login__input",type:"text",value:w,onChange:S=>I(S.target.value),placeholder:x??u("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:q,className:"nice-login__label",children:g??u("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:q,className:"nice-login__input",type:_?"text":"password",value:$,onChange:S=>D(S.target.value),placeholder:m??u("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:()=>P(!_),"aria-label":_?u("login.hidePassword","Hide password"):u("login.showPassword","Show password"),tabIndex:-1,children:e.jsx(l.NiceIcon,{name:_?"eye-off":"eye",size:16})})]})]}),e.jsxs("div",{className:"nice-login__options",children:[h&&e.jsxs("label",{className:"nice-login__remember",htmlFor:A,children:[e.jsx("input",{id:A,type:"checkbox",checked:E,onChange:S=>F(S.target.checked),disabled:r}),e.jsx("span",{children:u("login.rememberMe","Remember me")})]}),f&&t&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:t,disabled:r,children:u("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${c}`,disabled:r||!w||!$,children:r?u("login.loading","Signing in..."):u("login.submit","Sign In")}),b&&a&&e.jsxs("p",{className:"nice-login__register",children:[u("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:a,disabled:r,children:u("login.register","Register")})]})]})}),{displayName:"NiceLoginForm"});exports.NiceAlert=W;exports.NiceCookieConsent=te;exports.NiceDrawer=H;exports.NiceErrorBoundary=L;exports.NiceLoginForm=ie;exports.NiceOfflineBanner=ee;exports.NiceRetryPanel=se;exports.NiceTimeoutFeedback=ne;exports.NiceToastContainer=U;exports.alertIcons=z;exports.useNiceTimeout=B;exports.useNiceToast=J;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("@nice2dev/ui-core"),n=require("react"),V=require("./NiceButton-3AcJJ15c.cjs"),z={info:e.jsx(l.NiceIcon,{name:"info",size:20}),success:e.jsx(l.NiceIcon,{name:"success",size:20}),warning:e.jsx(l.NiceIcon,{name:"warning",size:20}),error:e.jsx(l.NiceIcon,{name:"error",size:20})},W=({variant:s="info",title:t,children:a,closable:r,onClose:i,icon:c,size:d="md",className:h,style:f,displayStyle:b})=>{const{t:N}=l.useNiceTranslation(),p=l.useComponentDisplayClass("card",b);return e.jsxs("div",{className:`nice-alert nice-alert--${s} nice-alert--${d} nice-alert--ds-${p} ${h||""}`,style:f,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${s}`,children:c||z[s]}),e.jsxs("div",{className:"nice-alert__content",children:[t&&e.jsx("div",{className:"nice-alert__title",children:t}),e.jsx("div",{children:a})]}),r&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:i,"aria-label":N("alert.close","Close"),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]})},H=({open:s,onClose:t,title:a,position:r="right",size:i="md",children:c,footer:d,transitionDuration:h,className:f,style:b,displayStyle:N})=>{const p=l.useComponentDisplayStyle("modal",N),j=l.useComponentDisplayClass("modal",N),{t:x}=l.useNiceTranslation(),k=n.useRef(null);return l.useFocusTrap(k,s),n.useEffect(()=>{if(!s)return;const m=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",m),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}},[s,t]),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onMouseDown:m=>{m.target===m.currentTarget&&t()}}),e.jsxs("div",{ref:k,className:`nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${j} ${f||""}`,style:{...p,...b,...h!=null?{transitionDuration:`${h}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:t,"aria-label":x("controls.close","Close"),children:e.jsx(l.NiceIcon,{name:"close",size:18})})]}),e.jsx("div",{className:"nice-drawer__body",children:c}),d&&e.jsx("div",{className:"nice-drawer__footer",children:d})]})]}):null},U=({toasts:s,onDismiss:t,position:a="top-right"})=>e.jsx("div",{className:`nice-toast-container nice-toast-container--${a}`,children:s.map(r=>e.jsx(Y,{toast:r,onDismiss:t},r.id))}),Y=({toast:s,onDismiss:t})=>{const{t:a}=l.useNiceTranslation(),[r,i]=n.useState(!1);return n.useEffect(()=>{if(!s.duration&&s.duration!==0){const c=setTimeout(()=>i(!0),4e3);return()=>clearTimeout(c)}if(s.duration>0){const c=setTimeout(()=>i(!0),s.duration);return()=>clearTimeout(c)}},[s.duration]),n.useEffect(()=>{if(r){const c=setTimeout(()=>t(s.id),200);return()=>clearTimeout(c)}},[r,s.id,t]),e.jsxs("div",{className:`nice-toast nice-toast--${s.variant} ${r?"nice-toast--exiting":""}`,role:"alert",style:{position:"relative"},children:[e.jsx("div",{className:"nice-toast__icon",children:z[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:()=>i(!0),"aria-label":a("toast.close","Close"),children:e.jsx(l.NiceIcon,{name:"close",size:16})})]})};let G=0;function J(){const[s,t]=n.useState([]),a=n.useCallback((i,c,d)=>{const h=`toast-${++G}`;return t(f=>[...f,{id:h,variant:i,message:c,title:d?.title,duration:d?.duration}]),h},[]),r=n.useCallback(i=>{t(c=>c.filter(d=>d.id!==i))},[]);return{toasts:s,dismiss:r,info:(i,c)=>a("info",i,c),success:(i,c)=>a("success",i,c),warning:(i,c)=>a("warning",i,c),error:(i,c)=>a("error",i,c)}}function K({error:s,showRetry:t,retryLabel:a,title:r,onReset:i}){const{t:c}=l.useNiceTranslation();return e.jsxs("div",{className:"nice-error-boundary",role:"alert",children:[e.jsx("div",{className:"nice-error-boundary__icon",children:e.jsx(l.NiceIcon,{name:"warning",size:32})}),e.jsx("h2",{className:"nice-error-boundary__title",children:r??c("errorBoundary.somethingWentWrong","Something went wrong")}),e.jsx("p",{className:"nice-error-boundary__message",children:s.message}),t&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:i,children:a??c("errorBoundary.retry","Retry")})]})}const O=class O extends n.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null},this.handleReset=()=>{this.setState({hasError:!1,error:null})}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,a){this.props.onError?.(t,a)}render(){if(this.state.hasError&&this.state.error){const{fallback:t,showRetry:a=!0,retryLabel:r,title:i}=this.props;return typeof t=="function"?t(this.state.error,this.handleReset):t||e.jsx(K,{error:this.state.error,showRetry:a,retryLabel:r,title:i,onReset:this.handleReset})}return this.props.children}};O.displayName="NiceErrorBoundary";let L=O;function Q(s){return window.addEventListener("online",s),window.addEventListener("offline",s),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s)}}function X(){return navigator.onLine}function Z(){return!0}const ee=({message:s,variant:t="warning",icon:a,online:r,size:i="md",className:c,style:d,"data-testid":h})=>{const{t:f}=l.useNiceTranslation(),b=n.useSyncExternalStore(Q,X,Z);return r??b?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${i} ${c||""}`,style:d,role:"alert","aria-live":"assertive","data-testid":h,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:a??e.jsx(l.NiceIcon,{name:"wifi",size:18})}),e.jsx("span",{className:"nice-offline-banner__message",children:s??f("offlineBanner.message","You are offline. Some features may be unavailable.")})]})},se=({error:s,onRetry:t,retryLabel:a,title:r,autoRetrySeconds:i,variant:c="error",icon:d,size:h="md",className:f,style:b,"data-testid":N})=>{const{t:p}=l.useNiceTranslation(),j=a??p("retryPanel.retry","Retry"),x=r??p("retryPanel.operationFailed","Operation failed"),[k,m]=n.useState(i??0),o=n.useRef(void 0),C=typeof s=="string"?s:s.message,w=n.useCallback(()=>{m(i??0),t()},[t,i]);return n.useEffect(()=>{if(!(!i||i<=0))return m(i),o.current=setInterval(()=>{m(g=>g<=1?(clearInterval(o.current),t(),0):g-1)},1e3),()=>clearInterval(o.current)},[i,t]),e.jsxs("div",{className:`nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${h} ${f||""}`,style:b,role:"alert","data-testid":N,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:d??e.jsx(l.NiceIcon,{name:"warning",size:24})}),e.jsxs("div",{className:"nice-retry-panel__content",children:[e.jsx("div",{className:"nice-retry-panel__title",children:x}),e.jsx("p",{className:"nice-retry-panel__message",children:C})]}),e.jsxs("div",{className:"nice-retry-panel__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:w,children:j}),i&&k>0&&e.jsx("span",{className:"nice-retry-panel__countdown",children:p("retryPanel.autoRetryInS","Auto-retry in {countdown}s").replace("{countdown}",String(k))})]})]})};function B({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:a,autoRetry:r=!1,autoRetryCount:i=3}={}){const[c,d]=n.useState(!1),[h,f]=n.useState(!1),[b,N]=n.useState(!1),[p,j]=n.useState(0),[x,k]=n.useState(0),m=n.useRef(null),o=n.useRef(null),C=n.useRef(null),w=n.useRef(0),g=n.useCallback(()=>{m.current&&clearTimeout(m.current),o.current&&clearTimeout(o.current),C.current&&clearInterval(C.current)},[]),v=n.useCallback(()=>{g(),d(!0),f(!1),N(!1),j(0),w.current=Date.now(),C.current=setInterval(()=>{j(Date.now()-w.current)},200),m.current=setTimeout(()=>{f(!0)},t),o.current=setTimeout(()=>{N(!0),d(!1),f(!1),g(),a?.()},s)},[g,t,s,a]),T=n.useCallback(()=>{g(),d(!1),f(!1)},[g]),u=n.useCallback(()=>{k(y=>y+1),N(!1),v()},[v]);return n.useEffect(()=>()=>g(),[g]),n.useEffect(()=>{if(r&&b&&x<i){const y=Math.pow(2,x)*1e3,I=setTimeout(()=>u(),y);return()=>clearTimeout(I)}},[r,i,b,x,u]),{isLoading:c,isSlow:h,isTimedOut:b,elapsed:p,retryCount:x,start:v,stop:T,retry:u}}const ne=({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:a,onRetry:r,autoRetry:i=!1,autoRetryCount:c=3,showProgress:d=!0,slowMessage:h,timeoutMessage:f,loading:b,children:N,size:p="md",className:j,style:x,"data-testid":k})=>{const{t:m}=l.useNiceTranslation(),{isSlow:o,isTimedOut:C,elapsed:w,start:g,stop:v,retry:T}=B({timeoutMs:s,slowThresholdMs:t,onTimeout:a,autoRetry:i,autoRetryCount:c}),u=n.useRef(g);u.current=g;const y=n.useRef(v);y.current=v,n.useEffect(()=>{b?u.current():y.current()},[b]);const I=()=>{T(),r?.()};if(!b)return e.jsx(e.Fragment,{children:N});if(C)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${p} ${j??""}`,style:x,role:"alert","data-testid":k,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:f??m("timeoutFeedback.timeout","The operation timed out. Please try again.")}),e.jsx(V.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--${p} ${o?"nice-timeout-feedback--slow":""} ${j??""}`,style:x,role:"status","aria-busy":"true","data-testid":k,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-hidden":"true"}),o&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:h??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:`${$}%`}})})]})},te=Object.assign(n.forwardRef(({visible:s,onAcceptAll:t,onRejectAll:a,onSave:r,categories:i=["necessary","analytics","marketing","preferences"],defaults:c,position:d="bottom",size:h="md",policyUrl:f,showDetails:b=!1,className:N,style:p,id:j,...x},k)=>{const m=l.useControlId(j),{t:o}=l.useNiceTranslation(),[C,w]=n.useState(!0),g=s??C,[v,T]=n.useState(b),[u,y]=n.useState(()=>{const _={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return c&&Object.assign(_,c),_.necessary=!0,_}),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.")},D=n.useCallback(()=>{const _={necessary:!0,analytics:!0,marketing:!0,preferences:!0};t?.(),r?.(_),w(!1)},[t,r]),E=n.useCallback(()=>{const _={necessary:!0,analytics:!1,marketing:!1,preferences:!1};a?.(),r?.(_),w(!1)},[a,r]),F=n.useCallback(()=>{r?.({...u,necessary:!0}),w(!1)},[u,r]);return g?e.jsx("div",{ref:k,id:m,className:`nice-cookie-consent nice-cookie-consent--${d} nice-cookie-consent--${h} ${N??""}`,style:p,role:"dialog","aria-label":o("cookie.label","Cookie Consent"),"aria-modal":"true",...x,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."),f&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:f,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:o("cookie.learnMore","Learn more")})]})]}),v&&e.jsx("div",{className:"nice-cookie-consent__details",children:i.map(_=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:u[_],disabled:_==="necessary",onChange:P=>y(R=>({...R,[_]:P.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:I[_]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:$[_]})]})]},_))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!v&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>T(!0),children:o("cookie.customize","Customize")}),v&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--save",onClick:F,children:o("cookie.savePreferences","Save preferences")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--reject",onClick:E,children:o("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:D,children:o("cookie.acceptAll","Accept all")})]})]})}):null}),{displayName:"NiceCookieConsent"}),ie=Object.assign(n.forwardRef(({onSubmit:s,onForgotPassword:t,onRegister:a,loading:r=!1,error:i,variant:c="primary",size:d="md",showRememberMe:h=!0,showForgotPassword:f=!0,showRegister:b=!1,title:N,logo:p,usernameLabel:j,passwordLabel:x,usernamePlaceholder:k,passwordPlaceholder:m,className:o,style:C,id:w,...g},v)=>{const T=l.useControlId(w),{t:u}=l.useNiceTranslation(),[y,I]=n.useState(""),[$,D]=n.useState(""),[E,F]=n.useState(!1),[_,P]=n.useState(!1),R=`${T}-user`,q=`${T}-pass`,A=`${T}-remember`,M=n.useCallback(S=>{S.preventDefault(),!r&&s?.({username:y,password:$,rememberMe:E})},[r,y,$,E,s]);return e.jsxs("form",{ref:v,id:T,className:`nice-login nice-login--${c} nice-login--${d} ${o??""}`,style:C,onSubmit:M,noValidate:!0,...g,children:[p&&e.jsx("div",{className:"nice-login__logo",children:p}),N&&e.jsx("h2",{className:"nice-login__title",children:N??u("login.title","Sign In")}),i&&e.jsx("div",{className:"nice-login__error",role:"alert",children:i}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:R,className:"nice-login__label",children:j??u("login.username","Username")}),e.jsx("input",{id:R,className:"nice-login__input",type:"text",value:y,onChange:S=>I(S.target.value),placeholder:k??u("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:q,className:"nice-login__label",children:x??u("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:q,className:"nice-login__input",type:_?"text":"password",value:$,onChange:S=>D(S.target.value),placeholder:m??u("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:()=>P(!_),"aria-label":_?u("login.hidePassword","Hide password"):u("login.showPassword","Show password"),tabIndex:-1,children:e.jsx(l.NiceIcon,{name:_?"eye-off":"eye",size:16})})]})]}),e.jsxs("div",{className:"nice-login__options",children:[h&&e.jsxs("label",{className:"nice-login__remember",htmlFor:A,children:[e.jsx("input",{id:A,type:"checkbox",checked:E,onChange:S=>F(S.target.checked),disabled:r}),e.jsx("span",{children:u("login.rememberMe","Remember me")})]}),f&&t&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:t,disabled:r,children:u("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${c}`,disabled:r||!y||!$,children:r?u("login.loading","Signing in..."):u("login.submit","Sign In")}),b&&a&&e.jsxs("p",{className:"nice-login__register",children:[u("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:a,disabled:r,children:u("login.register","Register")})]})]})}),{displayName:"NiceLoginForm"});exports.NiceAlert=W;exports.NiceCookieConsent=te;exports.NiceDrawer=H;exports.NiceErrorBoundary=L;exports.NiceLoginForm=ie;exports.NiceOfflineBanner=ee;exports.NiceRetryPanel=se;exports.NiceTimeoutFeedback=ne;exports.NiceToastContainer=U;exports.alertIcons=z;exports.useNiceTimeout=B;exports.useNiceToast=J;
|
package/dist/NiceLoginForm.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.nice-offline-banner{display:flex;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:1px solid currentColor;border-radius:var(--nice-radius-md, 6px);font-size:var(--nice-font-size-md, .875rem)}.nice-offline-banner--warning{background:var(--nice-warning-bg, #fef3c7);color:var(--nice-warning-text, #854d0e)}.nice-offline-banner--error{background:var(--nice-danger-bg, #fef2f2);color:var(--nice-danger-text, #991b1b)}.nice-offline-banner--sm{padding:var(--nice-space-1, 4px) var(--nice-space-2, 8px);font-size:var(--nice-font-size-sm, .8125rem)}.nice-offline-banner--lg{padding:var(--nice-space-3, 12px) var(--nice-space-4, 16px);font-size:var(--nice-font-size-lg, 1rem)}.nice-offline-banner__icon{display:inline-flex;flex-shrink:0}.nice-timeout-feedback{display:flex;flex-direction:column;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-4, 16px);color:var(--nice-text-primary, #0f172a);text-align:center}.nice-timeout-feedback__spinner{box-sizing:border-box;width:28px;height:28px;border:3px solid var(--nice-border-color, #cbd5e1);border-top-color:var(--nice-color-primary, #2563eb);border-radius:50%}.nice-timeout-feedback--sm .nice-timeout-feedback__spinner{width:20px;height:20px;border-width:2px}.nice-timeout-feedback--lg .nice-timeout-feedback__spinner{width:36px;height:36px}@media(prefers-reduced-motion:no-preference){.nice-timeout-feedback__spinner{animation:nice-timeout-feedback-spin .8s linear infinite}}@keyframes nice-timeout-feedback-spin{to{transform:rotate(360deg)}}.nice-timeout-feedback__slow-msg,.nice-timeout-feedback__message{margin:0;font-size:var(--nice-font-size-sm, .8125rem);color:var(--nice-text-secondary, #475569)}.nice-timeout-feedback--timeout .nice-timeout-feedback__message{color:var(--nice-danger-text, #991b1b)}.nice-timeout-feedback__progress{width:100%;max-width:280px;height:4px;overflow:hidden;border-radius:var(--nice-radius-full, 9999px);background:var(--nice-bg-secondary, #f1f5f9)}.nice-timeout-feedback__progress-bar{height:100%;background:var(--nice-color-primary, #2563eb);transition:width .2s linear}.nice-timeout-feedback--slow .nice-timeout-feedback__progress-bar{background:var(--nice-color-warning, #f59e0b)}
|
|
1
|
+
.nice-error-boundary{display:flex;flex-direction:column;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-6, 24px) var(--nice-space-4, 16px);text-align:center;color:var(--nice-text-primary, inherit);background:var(--nice-danger-bg, #fef2f2);border:1px solid color-mix(in srgb,var(--nice-color-danger, #ef4444) 30%,transparent);border-radius:var(--nice-radius-lg, 8px)}.nice-error-boundary__icon{display:inline-flex;color:var(--nice-color-danger, #ef4444)}.nice-error-boundary__title{margin:0;font-size:var(--nice-font-size-lg, 1rem);font-weight:var(--nice-font-weight-semibold, 600)}.nice-error-boundary__message{margin:0;max-width:60ch;color:var(--nice-text-secondary, #64748b);font-size:var(--nice-font-size-sm, .8125rem);overflow-wrap:anywhere}.nice-error-boundary .nice-btn{margin-top:var(--nice-space-1, 4px)}.nice-offline-banner{display:flex;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);border:1px solid currentColor;border-radius:var(--nice-radius-md, 6px);font-size:var(--nice-font-size-md, .875rem)}.nice-offline-banner--warning{background:var(--nice-warning-bg, #fef3c7);color:var(--nice-warning-text, #854d0e)}.nice-offline-banner--error{background:var(--nice-danger-bg, #fef2f2);color:var(--nice-danger-text, #991b1b)}.nice-offline-banner--sm{padding:var(--nice-space-1, 4px) var(--nice-space-2, 8px);font-size:var(--nice-font-size-sm, .8125rem)}.nice-offline-banner--lg{padding:var(--nice-space-3, 12px) var(--nice-space-4, 16px);font-size:var(--nice-font-size-lg, 1rem)}.nice-offline-banner__icon{display:inline-flex;flex-shrink:0}.nice-retry-panel{--nice-retry-panel-accent: var(--nice-color-danger, #ef4444);display:flex;align-items:flex-start;gap:var(--nice-space-3, 12px);padding:var(--nice-space-3, 12px) var(--nice-space-4, 16px);color:var(--nice-text-primary, inherit);background:color-mix(in srgb,var(--nice-retry-panel-accent) 8%,var(--nice-bg-primary, #fff));border:1px solid color-mix(in srgb,var(--nice-retry-panel-accent) 30%,transparent);border-radius:var(--nice-radius-lg, 8px)}.nice-retry-panel--warning{--nice-retry-panel-accent: var(--nice-color-warning, #f59e0b)}.nice-retry-panel--info{--nice-retry-panel-accent: var(--nice-color-info, #3b82f6)}.nice-retry-panel--sm,.nice-retry-panel--xs{gap:var(--nice-space-2, 8px);padding:var(--nice-space-2, 8px) var(--nice-space-3, 12px);font-size:var(--nice-font-size-sm, .8125rem)}.nice-retry-panel--lg,.nice-retry-panel--xl{padding:var(--nice-space-4, 16px) var(--nice-space-5, 20px)}.nice-retry-panel__icon{display:inline-flex;flex-shrink:0;color:var(--nice-retry-panel-accent)}.nice-retry-panel__content{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--nice-space-1, 4px);min-width:0}.nice-retry-panel__title{font-weight:var(--nice-font-weight-semibold, 600)}.nice-retry-panel__message{margin:0;color:var(--nice-text-secondary, #64748b);font-size:var(--nice-font-size-sm, .8125rem)}.nice-retry-panel__actions{display:flex;flex-direction:column;flex-shrink:0;align-items:flex-end;gap:var(--nice-space-1, 4px)}.nice-retry-panel__countdown{color:var(--nice-text-muted, #94a3b8);font-size:var(--nice-font-size-xs, .75rem);font-variant-numeric:tabular-nums}.nice-timeout-feedback{display:flex;flex-direction:column;align-items:center;gap:var(--nice-space-2, 8px);padding:var(--nice-space-4, 16px);color:var(--nice-text-primary, #0f172a);text-align:center}.nice-timeout-feedback__spinner{box-sizing:border-box;width:28px;height:28px;border:3px solid var(--nice-border-color, #cbd5e1);border-top-color:var(--nice-color-primary, #2563eb);border-radius:var(--nice-radius-circle, 50%)}.nice-timeout-feedback--sm .nice-timeout-feedback__spinner{width:20px;height:20px;border-width:2px}.nice-timeout-feedback--lg .nice-timeout-feedback__spinner{width:36px;height:36px}@media(prefers-reduced-motion:no-preference){.nice-timeout-feedback__spinner{animation:nice-timeout-feedback-spin .8s linear infinite}}@keyframes nice-timeout-feedback-spin{to{transform:rotate(360deg)}}.nice-timeout-feedback__slow-msg,.nice-timeout-feedback__message{margin:0;font-size:var(--nice-font-size-sm, .8125rem);color:var(--nice-text-secondary, #475569)}.nice-timeout-feedback--timeout .nice-timeout-feedback__message{color:var(--nice-danger-text, #991b1b)}.nice-timeout-feedback__progress{width:100%;max-width:280px;height:4px;overflow:hidden;border-radius:var(--nice-radius-full, 9999px);background:var(--nice-bg-secondary, #f1f5f9)}.nice-timeout-feedback__progress-bar{height:100%;background:var(--nice-color-primary, #2563eb);transition:width .2s linear}.nice-timeout-feedback--slow .nice-timeout-feedback__progress-bar{background:var(--nice-color-warning, #f59e0b)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",s="NiceMAM",t="Media Asset Management system for organizing digital media.",a="media",o="1.0.0",i="stable",n=[{name:"assets",type:"MediaAsset[]",description:"Media assets"},{name:"folders",type:"Folder[]",description:"Folder structure"},{name:"onUpload",type:"(files: File[]) => Promise<MediaAsset[]>",description:"Upload callback"},{name:"onDelete",type:"(asset: MediaAsset) => Promise<void>",description:"Delete callback"},{name:"onEdit",type:"(asset: MediaAsset) => void",description:"Edit callback"},{name:"showPreview",type:"boolean",default:"true",description:"Show asset preview"},{name:"showMetadata",type:"boolean",default:"true",description:"Show metadata panel"}],c=[{title:"Media Asset Manager",description:"Manage media assets",code:`<NiceMAM
|
|
2
|
+
assets={mediaAssets}
|
|
3
|
+
folders={folderTree}
|
|
4
|
+
onUpload={uploadAssets}
|
|
5
|
+
onDelete={deleteAsset}
|
|
6
|
+
showPreview
|
|
7
|
+
showMetadata
|
|
8
|
+
/>`}],d={keyboard:["Tab through assets","Enter to open"],aria:["Asset browser","Selection status"]},r=["NiceGallery","NiceDMS"],l={$schema:e,name:s,description:t,category:a,since:o,status:i,props:n,examples:c,accessibility:d,seeAlso:r};exports.$schema=e;exports.accessibility=d;exports.category=a;exports.default=l;exports.description=t;exports.examples=c;exports.name=s;exports.props=n;exports.seeAlso=r;exports.since=o;exports.status=i;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", s = "NiceMAM", t = "Media Asset Management system for organizing digital media.", a = "media", o = "1.0.0", i = "stable", n = [{ name: "assets", type: "MediaAsset[]", description: "Media assets" }, { name: "folders", type: "Folder[]", description: "Folder structure" }, { name: "onUpload", type: "(files: File[]) => Promise<MediaAsset[]>", description: "Upload callback" }, { name: "onDelete", type: "(asset: MediaAsset) => Promise<void>", description: "Delete callback" }, { name: "onEdit", type: "(asset: MediaAsset) => void", description: "Edit callback" }, { name: "showPreview", type: "boolean", default: "true", description: "Show asset preview" }, { name: "showMetadata", type: "boolean", default: "true", description: "Show metadata panel" }], d = [{ title: "Media Asset Manager", description: "Manage media assets", code: `<NiceMAM
|
|
2
|
+
assets={mediaAssets}
|
|
3
|
+
folders={folderTree}
|
|
4
|
+
onUpload={uploadAssets}
|
|
5
|
+
onDelete={deleteAsset}
|
|
6
|
+
showPreview
|
|
7
|
+
showMetadata
|
|
8
|
+
/>` }], c = { keyboard: ["Tab through assets", "Enter to open"], aria: ["Asset browser", "Selection status"] }, r = ["NiceGallery", "NiceDMS"], l = {
|
|
9
|
+
$schema: e,
|
|
10
|
+
name: s,
|
|
11
|
+
description: t,
|
|
12
|
+
category: a,
|
|
13
|
+
since: o,
|
|
14
|
+
status: i,
|
|
15
|
+
props: n,
|
|
16
|
+
examples: d,
|
|
17
|
+
accessibility: c,
|
|
18
|
+
seeAlso: r
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
e as $schema,
|
|
22
|
+
c as accessibility,
|
|
23
|
+
a as category,
|
|
24
|
+
l as default,
|
|
25
|
+
t as description,
|
|
26
|
+
d as examples,
|
|
27
|
+
s as name,
|
|
28
|
+
n as props,
|
|
29
|
+
r as seeAlso,
|
|
30
|
+
o as since,
|
|
31
|
+
i as status
|
|
32
|
+
};
|