@tantainnovative/ndpr-toolkit 4.1.0 → 5.0.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 (83) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +76 -12
  3. package/dist/chunk-4FXRJH37.js +1 -0
  4. package/dist/{chunk-UJGNW6CH.js → chunk-ASEUTU45.js} +1 -1
  5. package/dist/chunk-BRJKIF7E.mjs +1 -0
  6. package/dist/chunk-CSE36REY.js +6 -0
  7. package/dist/chunk-DKLJ5DYN.js +1 -0
  8. package/dist/chunk-FRMVSG4N.mjs +1 -0
  9. package/dist/chunk-MAD7QYRK.js +1 -0
  10. package/dist/chunk-NBOJ2KGN.mjs +1 -0
  11. package/dist/chunk-PQ5IPUJN.mjs +1 -0
  12. package/dist/chunk-QKXGVT2Q.js +1 -0
  13. package/dist/chunk-R2ZZMATR.js +1 -0
  14. package/dist/chunk-R3ZKV2J7.mjs +1 -0
  15. package/dist/chunk-RRVML7CU.mjs +1 -0
  16. package/dist/{chunk-6H6IXTHA.mjs → chunk-SBSYHCPK.mjs} +1 -1
  17. package/dist/chunk-TLIHFGIJ.js +1 -0
  18. package/dist/{chunk-O4ATGGVK.js → chunk-TVA6D6S4.js} +1 -1
  19. package/dist/chunk-WPH6CJDL.mjs +6 -0
  20. package/dist/{chunk-6OPGI27L.mjs → chunk-ZSRO4L3C.mjs} +1 -1
  21. package/dist/consent.d.mts +59 -21
  22. package/dist/consent.d.ts +59 -21
  23. package/dist/consent.js +1 -1
  24. package/dist/consent.mjs +1 -1
  25. package/dist/core.d.mts +116 -74
  26. package/dist/core.d.ts +116 -74
  27. package/dist/core.js +1 -1
  28. package/dist/core.mjs +1 -1
  29. package/dist/cross-border.d.mts +4 -27
  30. package/dist/cross-border.d.ts +4 -27
  31. package/dist/cross-border.js +1 -1
  32. package/dist/cross-border.mjs +1 -1
  33. package/dist/dsr.d.mts +86 -57
  34. package/dist/dsr.d.ts +86 -57
  35. package/dist/dsr.js +1 -1
  36. package/dist/dsr.mjs +1 -1
  37. package/dist/headless.d.mts +20 -27
  38. package/dist/headless.d.ts +20 -27
  39. package/dist/headless.js +1 -1
  40. package/dist/headless.mjs +1 -1
  41. package/dist/hooks.d.mts +20 -27
  42. package/dist/hooks.d.ts +20 -27
  43. package/dist/hooks.js +1 -1
  44. package/dist/hooks.mjs +1 -1
  45. package/dist/index.d.mts +37 -202
  46. package/dist/index.d.ts +37 -202
  47. package/dist/index.js +1 -1
  48. package/dist/index.mjs +1 -1
  49. package/dist/lawful-basis.d.mts +3 -24
  50. package/dist/lawful-basis.d.ts +3 -24
  51. package/dist/lawful-basis.js +1 -1
  52. package/dist/lawful-basis.mjs +1 -1
  53. package/dist/presets.d.mts +1 -9
  54. package/dist/presets.d.ts +1 -9
  55. package/dist/presets.js +1 -1
  56. package/dist/presets.mjs +1 -1
  57. package/dist/ropa-lite.d.mts +2 -11
  58. package/dist/ropa-lite.d.ts +2 -11
  59. package/dist/ropa-lite.js +1 -1
  60. package/dist/ropa-lite.mjs +1 -1
  61. package/dist/ropa.d.mts +10 -52
  62. package/dist/ropa.d.ts +10 -52
  63. package/dist/ropa.js +1 -1
  64. package/dist/ropa.mjs +1 -1
  65. package/dist/server.d.mts +20 -100
  66. package/dist/server.d.ts +20 -100
  67. package/dist/server.js +1 -1
  68. package/dist/server.mjs +1 -1
  69. package/package.json +1 -1
  70. package/dist/chunk-3APT25XO.mjs +0 -1
  71. package/dist/chunk-45D7AMB3.js +0 -1
  72. package/dist/chunk-65J4P5ID.js +0 -1
  73. package/dist/chunk-7Z7NURIA.mjs +0 -1
  74. package/dist/chunk-D3HHDWBR.js +0 -1
  75. package/dist/chunk-DSIIEUAD.mjs +0 -1
  76. package/dist/chunk-H2FDWK4F.js +0 -6
  77. package/dist/chunk-HLFS3NXG.js +0 -1
  78. package/dist/chunk-JGY65SHX.mjs +0 -1
  79. package/dist/chunk-NI54X543.mjs +0 -1
  80. package/dist/chunk-P5MPUC5F.js +0 -1
  81. package/dist/chunk-ROOUYQD4.js +0 -1
  82. package/dist/chunk-UTXDZDYF.mjs +0 -6
  83. package/dist/chunk-W6VVLHRQ.mjs +0 -1
package/dist/presets.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- 'use strict';var chunk63WM5PHZ_js=require('./chunk-63WM5PHZ.js'),chunkKH3EQJQE_js=require('./chunk-KH3EQJQE.js'),chunk3E4IH7CE_js=require('./chunk-3E4IH7CE.js');require('./chunk-F5MGMNQF.js');var chunkNUWVPRNI_js=require('./chunk-NUWVPRNI.js'),chunkD2UWB5OI_js=require('./chunk-D2UWB5OI.js'),chunk65J4P5ID_js=require('./chunk-65J4P5ID.js'),chunkH2FDWK4F_js=require('./chunk-H2FDWK4F.js'),chunkHLFS3NXG_js=require('./chunk-HLFS3NXG.js');require('./chunk-NUOHT3LO.js'),require('./chunk-QHW4UKGJ.js'),require('./chunk-JS7SYL5P.js');var chunkRDALAH3Y_js=require('./chunk-RDALAH3Y.js');require('./chunk-6LJHLE6G.js'),require('./chunk-YFBDJ4FH.js'),require('./chunk-WZYCBW2R.js'),require('./chunk-4CVBQC66.js'),require('./chunk-ZD2W3YU2.js'),require('./chunk-L2VO3MEJ.js'),require('./chunk-UZNWXJ2W.js'),require('./chunk-UXUMYP4L.js');var chunkWCTFED27_js=require('./chunk-WCTFED27.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js');require('./chunk-ZVOIR4QH.js'),require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-VWED6UTN.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),jsxRuntime=require('react/jsx-runtime'),react=require('react');var $=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],j=({categories:u=$,adapter:a,classNames:P,unstyled:h,onSubmit:r=()=>{},copy:o,description:n,submitTo:i,submitOptions:s,onSubmitError:l,onSubmitSuccess:R})=>{var e;let c=d=>chunkRFPLZDIO_js.d(null,null,function*(){var f,N;if(i){let x=typeof(s==null?void 0:s.headers)=="function"?s.headers():(f=s==null?void 0:s.headers)!=null?f:{};try{let A=yield fetch(i,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},x),credentials:(N=s==null?void 0:s.credentials)!=null?N:"same-origin",body:JSON.stringify(d)});if(!A.ok)l==null||l({response:A});else if(R){let w;try{let y=yield A.clone().text();y&&(w=JSON.parse(y));}catch(y){}R({response:A,data:d,body:w});}}catch(A){l==null||l({error:A});}}else a&&a.save(d);r(d);}),t=(e=o==null?void 0:o.description)!=null?e:n;return jsxRuntime.jsx(chunkD2UWB5OI_js.a,{categories:u,onSubmit:c,classNames:P,unstyled:h,title:o==null?void 0:o.title,description:t,submitButtonText:o==null?void 0:o.submitButton})};var H=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}];function K(u,a){let P=[],h=i=>{let s=a[i.id];if(s!=null&&i.riskLevel)if(["select","radio","checkbox"].includes(i.type)&&i.options)(Array.isArray(s)?s:[s]).forEach(R=>{var t;let c=(t=i.options)==null?void 0:t.find(e=>e.value===R);if(c!=null&&c.riskLevel){let e=c.riskLevel,d=e==="low"?1:e==="medium"?3:5,f=e==="low"?1:e==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:`${i.text} - ${c.label}`,likelihood:d,impact:f,score:d*f,level:e,mitigated:false,relatedQuestionIds:[i.id]});}});else {let l=i.riskLevel,R=l==="low"?1:l==="medium"?3:5,c=l==="low"?1:l==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:i.text,likelihood:R,impact:c,score:R*c,level:l,mitigated:false,relatedQuestionIds:[i.id]});}};u.forEach(i=>i.questions.forEach(h));let r=Date.now(),o={id:`dpia_${r}`,title:"",processingDescription:"",startedAt:r,completedAt:r,assessor:{name:"",role:"",email:""},answers:a,risks:P,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},n=chunkTQZWJGJ2_js.a(o);return o.overallRiskLevel=n.overallRiskLevel,o.canProceed=n.canProceed,o.conclusion=n.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",o.recommendations=n.recommendations,o}var X=({sections:u=H,adapter:a,classNames:P,unstyled:h,onComplete:r,onResult:o,copy:n,submitTo:i,submitOptions:s,onSubmitError:l,onSubmitSuccess:R})=>{let[c,t]=react.useState({}),[e,d]=react.useState(0),f=react.useRef(false);react.useEffect(()=>{process.env.NODE_ENV==="production"||f.current||r!==void 0&&o===void 0&&(f.current=true,console.warn("[ndpr-toolkit/dpia] `onComplete` is deprecated; use `onResult` to receive the full DPIAResult. Will be removed in 5.0."));},[r,o]);let N=(v,C)=>{t(B=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},B),{[v]:C}));},x=v=>chunkRFPLZDIO_js.d(null,null,function*(){var C,B;if(i){let Q=typeof(s==null?void 0:s.headers)=="function"?s.headers():(C=s==null?void 0:s.headers)!=null?C:{};try{let D=yield fetch(i,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},Q),credentials:(B=s==null?void 0:s.credentials)!=null?B:"same-origin",body:JSON.stringify(v)});if(!D.ok)l==null||l({response:D});else if(R){let I;try{let k=yield D.clone().text();k&&(I=JSON.parse(k));}catch(k){}R({response:D,data:v,body:I});}}catch(D){l==null||l({error:D});}}else a&&a.save(v);o&&o(K(u,v)),r==null||r(v);}),A=()=>{e<u.length-1?d(v=>v+1):x(c);},w=()=>{e>0&&d(v=>v-1);},y=Math.round((e+1)/u.length*100);return jsxRuntime.jsx(chunkWCTFED27_js.a,{sections:u,answers:c,onAnswerChange:N,currentSectionIndex:e,onNextSection:A,onPrevSection:w,progress:y,classNames:P,unstyled:h,submitButtonText:n==null?void 0:n.submitButton,nextButtonText:n==null?void 0:n.nextButton,prevButtonText:n==null?void 0:n.prevButton})};var te=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let o=u!=null?u:[],[n,i]=react.useState(()=>{if(a){let t=a.load();if(t&&!(t instanceof Promise))return t}return o});react.useEffect(()=>{if(!a)return;let t=false;return chunkRFPLZDIO_js.d(null,null,function*(){try{let e=yield a.load();!t&&e&&i(e);}catch(e){}}),()=>{t=true;}},[a]);let s=t=>{a&&a.save(t);};return jsxRuntime.jsx(chunk65J4P5ID_js.a,{activities:n,onAdd:t=>{let e=Date.now(),d=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:`activity-${e}`,createdAt:e,updatedAt:e}),f=[...n,d];i(f),s(f);},onUpdate:(t,e)=>{let d=n.map(f=>f.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},f),e),{updatedAt:Date.now()}):f);i(d),s(d);},onArchive:t=>{let e=n.map(d=>d.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},d),{status:"inactive",updatedAt:Date.now()}):d);i(e),s(e);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ae=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let o=u!=null?u:[],[n,i]=react.useState(()=>{if(a){let t=a.load();if(t&&!(t instanceof Promise))return t}return o});react.useEffect(()=>{if(!a)return;let t=false;return chunkRFPLZDIO_js.d(null,null,function*(){try{let e=yield a.load();!t&&e&&i(e);}catch(e){}}),()=>{t=true;}},[a]);let s=t=>{a&&a.save(t);};return jsxRuntime.jsx(chunkH2FDWK4F_js.a,{transfers:n,onAdd:t=>{let e=Date.now(),d=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:`transfer-${e}`,createdAt:e,updatedAt:e}),f=[...n,d];i(f),s(f);},onUpdate:(t,e)=>{let d=n.map(f=>f.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},f),e),{updatedAt:Date.now()}):f);i(d),s(d);},onArchive:t=>{let e=n.filter(d=>d.id!==t);i(e),s(e);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ce={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},le=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let[o,n]=react.useState(u!=null?u:ce);react.useEffect(()=>{if(!a)return;let c=false;return chunkRFPLZDIO_js.d(null,null,function*(){let e=yield a.load();!c&&e&&n(e);}),()=>{c=true;}},[a]);let i=c=>{a&&a.save(c);};return jsxRuntime.jsx(chunkHLFS3NXG_js.a,{ropa:o,onAdd:c=>{let t=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{records:[...o.records,c],lastUpdated:Date.now()});n(t),i(t);},onUpdate:(c,t)=>{let e=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{records:o.records.map(d=>d.id===c?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},d),t),{updatedAt:Date.now()}):d),lastUpdated:Date.now()});n(e),i(e);},onArchive:c=>{let t=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{records:o.records.map(e=>e.id===c?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{status:"archived",updatedAt:Date.now()}):e),lastUpdated:Date.now()});n(t),i(t);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ue=P=>{var h=P,{input:u}=h,a=chunkRFPLZDIO_js.c(h,["input"]);let r=chunkRDALAH3Y_js.a(u);return jsxRuntime.jsx(chunkNUWVPRNI_js.a,chunkRFPLZDIO_js.a({report:r},a))};Object.defineProperty(exports,"NDPRConsent",{enumerable:true,get:function(){return chunk63WM5PHZ_js.a}});Object.defineProperty(exports,"NDPRSubjectRights",{enumerable:true,get:function(){return chunkKH3EQJQE_js.a}});Object.defineProperty(exports,"NDPRPrivacyPolicy",{enumerable:true,get:function(){return chunk3E4IH7CE_js.a}});exports.NDPRBreachReport=j;exports.NDPRComplianceDashboard=ue;exports.NDPRCrossBorder=ae;exports.NDPRDPIA=X;exports.NDPRLawfulBasis=te;exports.NDPRROPA=le;
2
+ 'use strict';var chunk63WM5PHZ_js=require('./chunk-63WM5PHZ.js'),chunkKH3EQJQE_js=require('./chunk-KH3EQJQE.js'),chunk3E4IH7CE_js=require('./chunk-3E4IH7CE.js');require('./chunk-F5MGMNQF.js');var chunkNUWVPRNI_js=require('./chunk-NUWVPRNI.js'),chunkD2UWB5OI_js=require('./chunk-D2UWB5OI.js'),chunk4FXRJH37_js=require('./chunk-4FXRJH37.js'),chunkCSE36REY_js=require('./chunk-CSE36REY.js'),chunkMAD7QYRK_js=require('./chunk-MAD7QYRK.js');require('./chunk-NUOHT3LO.js'),require('./chunk-QHW4UKGJ.js'),require('./chunk-JS7SYL5P.js');var chunkRDALAH3Y_js=require('./chunk-RDALAH3Y.js');require('./chunk-6LJHLE6G.js'),require('./chunk-YFBDJ4FH.js'),require('./chunk-WZYCBW2R.js'),require('./chunk-4CVBQC66.js'),require('./chunk-ZD2W3YU2.js'),require('./chunk-L2VO3MEJ.js'),require('./chunk-UZNWXJ2W.js'),require('./chunk-UXUMYP4L.js');var chunkWCTFED27_js=require('./chunk-WCTFED27.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js');require('./chunk-ZVOIR4QH.js'),require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-VWED6UTN.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),jsxRuntime=require('react/jsx-runtime'),react=require('react');var W=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],Y=({categories:p=W,adapter:o,classNames:P,unstyled:h,onSubmit:a=()=>{},copy:r,description:c,submitTo:s,submitOptions:i,onSubmitError:f,onSubmitSuccess:R})=>{var e;let d=n=>chunkRFPLZDIO_js.d(null,null,function*(){var u,N;if(s){let C=typeof(i==null?void 0:i.headers)=="function"?i.headers():(u=i==null?void 0:i.headers)!=null?u:{};try{let A=yield fetch(s,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},C),credentials:(N=i==null?void 0:i.credentials)!=null?N:"same-origin",body:JSON.stringify(n)});if(!A.ok)f==null||f({response:A});else if(R){let v;try{let D=yield A.clone().text();D&&(v=JSON.parse(D));}catch(D){}R({response:A,data:n,body:v});}}catch(A){f==null||f({error:A});}}else o&&o.save(n);a(n);}),t=(e=r==null?void 0:r.description)!=null?e:c;return jsxRuntime.jsx(chunkD2UWB5OI_js.a,{categories:p,onSubmit:d,classNames:P,unstyled:h,title:r==null?void 0:r.title,description:t,submitButtonText:r==null?void 0:r.submitButton})};var j=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}];function J(p,o){let P=[],h=s=>{let i=o[s.id];if(i!=null&&s.riskLevel)if(["select","radio","checkbox"].includes(s.type)&&s.options)(Array.isArray(i)?i:[i]).forEach(R=>{var t;let d=(t=s.options)==null?void 0:t.find(e=>e.value===R);if(d!=null&&d.riskLevel){let e=d.riskLevel,n=e==="low"?1:e==="medium"?3:5,u=e==="low"?1:e==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:`${s.text} - ${d.label}`,likelihood:n,impact:u,score:n*u,level:e,mitigated:false,relatedQuestionIds:[s.id]});}});else {let f=s.riskLevel,R=f==="low"?1:f==="medium"?3:5,d=f==="low"?1:f==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:s.text,likelihood:R,impact:d,score:R*d,level:f,mitigated:false,relatedQuestionIds:[s.id]});}};p.forEach(s=>s.questions.forEach(h));let a=Date.now(),r={id:`dpia_${a}`,title:"",processingDescription:"",startedAt:a,completedAt:a,assessor:{name:"",role:"",email:""},answers:o,risks:P,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},c=chunkTQZWJGJ2_js.a(r);return r.overallRiskLevel=c.overallRiskLevel,r.canProceed=c.canProceed,r.conclusion=c.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",r.recommendations=c.recommendations,r}var V=({sections:p=j,adapter:o,classNames:P,unstyled:h,onResult:a,copy:r,submitTo:c,submitOptions:s,onSubmitError:i,onSubmitSuccess:f})=>{let[R,d]=react.useState({}),[t,e]=react.useState(0),n=(v,D)=>{d(w=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},w),{[v]:D}));},u=v=>chunkRFPLZDIO_js.d(null,null,function*(){var D,w;if(c){let q=typeof(s==null?void 0:s.headers)=="function"?s.headers():(D=s==null?void 0:s.headers)!=null?D:{};try{let y=yield fetch(c,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},q),credentials:(w=s==null?void 0:s.credentials)!=null?w:"same-origin",body:JSON.stringify(v)});if(!y.ok)i==null||i({response:y});else if(f){let x;try{let B=yield y.clone().text();B&&(x=JSON.parse(B));}catch(B){}f({response:y,data:v,body:x});}}catch(y){i==null||i({error:y});}}else o&&o.save(v);a==null||a(J(p,v));}),N=()=>{t<p.length-1?e(v=>v+1):u(R);},C=()=>{t>0&&e(v=>v-1);},A=Math.round((t+1)/p.length*100);return jsxRuntime.jsx(chunkWCTFED27_js.a,{sections:p,answers:R,onAnswerChange:n,currentSectionIndex:t,onNextSection:N,onPrevSection:C,progress:A,classNames:P,unstyled:h,submitButtonText:r==null?void 0:r.submitButton,nextButtonText:r==null?void 0:r.nextButton,prevButtonText:r==null?void 0:r.prevButton})};var X=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let r=p!=null?p:[],[c,s]=react.useState(()=>{if(o){let t=o.load();if(t&&!(t instanceof Promise))return t}return r});react.useEffect(()=>{if(!o)return;let t=false;return chunkRFPLZDIO_js.d(null,null,function*(){try{let e=yield o.load();!t&&e&&s(e);}catch(e){}}),()=>{t=true;}},[o]);let i=t=>{o&&o.save(t);};return jsxRuntime.jsx(chunk4FXRJH37_js.a,{activities:c,onAdd:t=>{let e=Date.now(),n=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:`activity-${e}`,createdAt:e,updatedAt:e}),u=[...c,n];s(u),i(u);},onUpdate:(t,e)=>{let n=c.map(u=>u.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},u),e),{updatedAt:Date.now()}):u);s(n),i(n);},onArchive:t=>{let e=c.map(n=>n.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},n),{status:"inactive",updatedAt:Date.now()}):n);s(e),i(e);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var te=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let r=p!=null?p:[],[c,s]=react.useState(()=>{if(o){let t=o.load();if(t&&!(t instanceof Promise))return t}return r});react.useEffect(()=>{if(!o)return;let t=false;return chunkRFPLZDIO_js.d(null,null,function*(){try{let e=yield o.load();!t&&e&&s(e);}catch(e){}}),()=>{t=true;}},[o]);let i=t=>{o&&o.save(t);};return jsxRuntime.jsx(chunkCSE36REY_js.a,{transfers:c,onAdd:t=>{let e=Date.now(),n=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:`transfer-${e}`,createdAt:e,updatedAt:e}),u=[...c,n];s(u),i(u);},onUpdate:(t,e)=>{let n=c.map(u=>u.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},u),e),{updatedAt:Date.now()}):u);s(n),i(n);},onArchive:t=>{let e=c.filter(n=>n.id!==t);s(e),i(e);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var ae={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},ie=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let[r,c]=react.useState(p!=null?p:ae);react.useEffect(()=>{if(!o)return;let d=false;return chunkRFPLZDIO_js.d(null,null,function*(){let e=yield o.load();!d&&e&&c(e);}),()=>{d=true;}},[o]);let s=d=>{o&&o.save(d);};return jsxRuntime.jsx(chunkMAD7QYRK_js.a,{ropa:r,onAdd:d=>{let t=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{records:[...r.records,d],lastUpdated:Date.now()});c(t),s(t);},onUpdate:(d,t)=>{let e=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{records:r.records.map(n=>n.id===d?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},n),t),{updatedAt:Date.now()}):n),lastUpdated:Date.now()});c(e),s(e);},onArchive:d=>{let t=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{records:r.records.map(e=>e.id===d?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{status:"archived",updatedAt:Date.now()}):e),lastUpdated:Date.now()});c(t),s(t);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var de=P=>{var h=P,{input:p}=h,o=chunkRFPLZDIO_js.c(h,["input"]);let a=chunkRDALAH3Y_js.a(p);return jsxRuntime.jsx(chunkNUWVPRNI_js.a,chunkRFPLZDIO_js.a({report:a},o))};Object.defineProperty(exports,"NDPRConsent",{enumerable:true,get:function(){return chunk63WM5PHZ_js.a}});Object.defineProperty(exports,"NDPRSubjectRights",{enumerable:true,get:function(){return chunkKH3EQJQE_js.a}});Object.defineProperty(exports,"NDPRPrivacyPolicy",{enumerable:true,get:function(){return chunk3E4IH7CE_js.a}});exports.NDPRBreachReport=Y;exports.NDPRComplianceDashboard=de;exports.NDPRCrossBorder=te;exports.NDPRDPIA=V;exports.NDPRLawfulBasis=X;exports.NDPRROPA=ie;
package/dist/presets.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{a as NDPRConsent}from'./chunk-6A6VI7ZP.mjs';export{a as NDPRSubjectRights}from'./chunk-WVHMY2BV.mjs';export{a as NDPRPrivacyPolicy}from'./chunk-B2EXRSYG.mjs';import'./chunk-ELK6VFKC.mjs';import {a as a$7}from'./chunk-ZIZL37BG.mjs';import {a}from'./chunk-DK7P5JEG.mjs';import {a as a$2}from'./chunk-DSIIEUAD.mjs';import {a as a$4}from'./chunk-UTXDZDYF.mjs';import {a as a$5}from'./chunk-W6VVLHRQ.mjs';import'./chunk-CWY2FMIC.mjs';import'./chunk-KE2FZH2V.mjs';import'./chunk-IVSNHT24.mjs';import {a as a$6}from'./chunk-7RBO42IW.mjs';import'./chunk-BIJSMSUU.mjs';import'./chunk-7BJXI2HI.mjs';import'./chunk-LWIKDDSU.mjs';import'./chunk-XP5PL6K7.mjs';import'./chunk-I2ZBMR7F.mjs';import'./chunk-YTU4FNM2.mjs';import'./chunk-L3FR4PQE.mjs';import'./chunk-EWVK45Z3.mjs';import {a as a$1}from'./chunk-ZQHGIOYP.mjs';import {a as a$8}from'./chunk-LRRENTT5.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-DBZSN4WP.mjs';import {d,b,a as a$3,c}from'./chunk-ZJYULEER.mjs';import {jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';var $=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],j=({categories:u=$,adapter:a$1,classNames:P,unstyled:h,onSubmit:r=()=>{},copy:o,description:n,submitTo:i,submitOptions:s,onSubmitError:l,onSubmitSuccess:R})=>{var e;let c=d$1=>d(null,null,function*(){var f,N;if(i){let x=typeof(s==null?void 0:s.headers)=="function"?s.headers():(f=s==null?void 0:s.headers)!=null?f:{};try{let A=yield fetch(i,{method:"POST",headers:a$3({"Content-Type":"application/json"},x),credentials:(N=s==null?void 0:s.credentials)!=null?N:"same-origin",body:JSON.stringify(d$1)});if(!A.ok)l==null||l({response:A});else if(R){let w;try{let y=yield A.clone().text();y&&(w=JSON.parse(y));}catch(y){}R({response:A,data:d$1,body:w});}}catch(A){l==null||l({error:A});}}else a$1&&a$1.save(d$1);r(d$1);}),t=(e=o==null?void 0:o.description)!=null?e:n;return jsx(a,{categories:u,onSubmit:c,classNames:P,unstyled:h,title:o==null?void 0:o.title,description:t,submitButtonText:o==null?void 0:o.submitButton})};var H=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}];function K(u,a){let P=[],h=i=>{let s=a[i.id];if(s!=null&&i.riskLevel)if(["select","radio","checkbox"].includes(i.type)&&i.options)(Array.isArray(s)?s:[s]).forEach(R=>{var t;let c=(t=i.options)==null?void 0:t.find(e=>e.value===R);if(c!=null&&c.riskLevel){let e=c.riskLevel,d=e==="low"?1:e==="medium"?3:5,f=e==="low"?1:e==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:`${i.text} - ${c.label}`,likelihood:d,impact:f,score:d*f,level:e,mitigated:false,relatedQuestionIds:[i.id]});}});else {let l=i.riskLevel,R=l==="low"?1:l==="medium"?3:5,c=l==="low"?1:l==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:i.text,likelihood:R,impact:c,score:R*c,level:l,mitigated:false,relatedQuestionIds:[i.id]});}};u.forEach(i=>i.questions.forEach(h));let r=Date.now(),o={id:`dpia_${r}`,title:"",processingDescription:"",startedAt:r,completedAt:r,assessor:{name:"",role:"",email:""},answers:a,risks:P,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},n=a$8(o);return o.overallRiskLevel=n.overallRiskLevel,o.canProceed=n.canProceed,o.conclusion=n.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",o.recommendations=n.recommendations,o}var X=({sections:u=H,adapter:a,classNames:P,unstyled:h,onComplete:r,onResult:o,copy:n,submitTo:i,submitOptions:s,onSubmitError:l,onSubmitSuccess:R})=>{let[c,t]=useState({}),[e,d$1]=useState(0),f=useRef(false);useEffect(()=>{process.env.NODE_ENV==="production"||f.current||r!==void 0&&o===void 0&&(f.current=true,console.warn("[ndpr-toolkit/dpia] `onComplete` is deprecated; use `onResult` to receive the full DPIAResult. Will be removed in 5.0."));},[r,o]);let N=(v,C)=>{t(B=>b(a$3({},B),{[v]:C}));},x=v=>d(null,null,function*(){var C,B;if(i){let Q=typeof(s==null?void 0:s.headers)=="function"?s.headers():(C=s==null?void 0:s.headers)!=null?C:{};try{let D=yield fetch(i,{method:"POST",headers:a$3({"Content-Type":"application/json"},Q),credentials:(B=s==null?void 0:s.credentials)!=null?B:"same-origin",body:JSON.stringify(v)});if(!D.ok)l==null||l({response:D});else if(R){let I;try{let k=yield D.clone().text();k&&(I=JSON.parse(k));}catch(k){}R({response:D,data:v,body:I});}}catch(D){l==null||l({error:D});}}else a&&a.save(v);o&&o(K(u,v)),r==null||r(v);}),A=()=>{e<u.length-1?d$1(v=>v+1):x(c);},w=()=>{e>0&&d$1(v=>v-1);},y=Math.round((e+1)/u.length*100);return jsx(a$1,{sections:u,answers:c,onAnswerChange:N,currentSectionIndex:e,onNextSection:A,onPrevSection:w,progress:y,classNames:P,unstyled:h,submitButtonText:n==null?void 0:n.submitButton,nextButtonText:n==null?void 0:n.nextButton,prevButtonText:n==null?void 0:n.prevButton})};var te=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let o=u!=null?u:[],[n,i]=useState(()=>{if(a){let t=a.load();if(t&&!(t instanceof Promise))return t}return o});useEffect(()=>{if(!a)return;let t=false;return d(null,null,function*(){try{let e=yield a.load();!t&&e&&i(e);}catch(e){}}),()=>{t=true;}},[a]);let s=t=>{a&&a.save(t);};return jsx(a$2,{activities:n,onAdd:t=>{let e=Date.now(),d=b(a$3({},t),{id:`activity-${e}`,createdAt:e,updatedAt:e}),f=[...n,d];i(f),s(f);},onUpdate:(t,e)=>{let d=n.map(f=>f.id===t?b(a$3(a$3({},f),e),{updatedAt:Date.now()}):f);i(d),s(d);},onArchive:t=>{let e=n.map(d=>d.id===t?b(a$3({},d),{status:"inactive",updatedAt:Date.now()}):d);i(e),s(e);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ae=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let o=u!=null?u:[],[n,i]=useState(()=>{if(a){let t=a.load();if(t&&!(t instanceof Promise))return t}return o});useEffect(()=>{if(!a)return;let t=false;return d(null,null,function*(){try{let e=yield a.load();!t&&e&&i(e);}catch(e){}}),()=>{t=true;}},[a]);let s=t=>{a&&a.save(t);};return jsx(a$4,{transfers:n,onAdd:t=>{let e=Date.now(),d=b(a$3({},t),{id:`transfer-${e}`,createdAt:e,updatedAt:e}),f=[...n,d];i(f),s(f);},onUpdate:(t,e)=>{let d=n.map(f=>f.id===t?b(a$3(a$3({},f),e),{updatedAt:Date.now()}):f);i(d),s(d);},onArchive:t=>{let e=n.filter(d=>d.id!==t);i(e),s(e);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ce={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},le=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let[o,n]=useState(u!=null?u:ce);useEffect(()=>{if(!a)return;let c=false;return d(null,null,function*(){let e=yield a.load();!c&&e&&n(e);}),()=>{c=true;}},[a]);let i=c=>{a&&a.save(c);};return jsx(a$5,{ropa:o,onAdd:c=>{let t=b(a$3({},o),{records:[...o.records,c],lastUpdated:Date.now()});n(t),i(t);},onUpdate:(c,t)=>{let e=b(a$3({},o),{records:o.records.map(d=>d.id===c?b(a$3(a$3({},d),t),{updatedAt:Date.now()}):d),lastUpdated:Date.now()});n(e),i(e);},onArchive:c=>{let t=b(a$3({},o),{records:o.records.map(e=>e.id===c?b(a$3({},e),{status:"archived",updatedAt:Date.now()}):e),lastUpdated:Date.now()});n(t),i(t);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ue=P=>{var h=P,{input:u}=h,a=c(h,["input"]);let r=a$6(u);return jsx(a$7,a$3({report:r},a))};export{j as NDPRBreachReport,ue as NDPRComplianceDashboard,ae as NDPRCrossBorder,X as NDPRDPIA,te as NDPRLawfulBasis,le as NDPRROPA};
2
+ export{a as NDPRConsent}from'./chunk-6A6VI7ZP.mjs';export{a as NDPRSubjectRights}from'./chunk-WVHMY2BV.mjs';export{a as NDPRPrivacyPolicy}from'./chunk-B2EXRSYG.mjs';import'./chunk-ELK6VFKC.mjs';import {a as a$7}from'./chunk-ZIZL37BG.mjs';import {a}from'./chunk-DK7P5JEG.mjs';import {a as a$2}from'./chunk-NBOJ2KGN.mjs';import {a as a$4}from'./chunk-WPH6CJDL.mjs';import {a as a$5}from'./chunk-BRJKIF7E.mjs';import'./chunk-CWY2FMIC.mjs';import'./chunk-KE2FZH2V.mjs';import'./chunk-IVSNHT24.mjs';import {a as a$6}from'./chunk-7RBO42IW.mjs';import'./chunk-BIJSMSUU.mjs';import'./chunk-7BJXI2HI.mjs';import'./chunk-LWIKDDSU.mjs';import'./chunk-XP5PL6K7.mjs';import'./chunk-I2ZBMR7F.mjs';import'./chunk-YTU4FNM2.mjs';import'./chunk-L3FR4PQE.mjs';import'./chunk-EWVK45Z3.mjs';import {a as a$1}from'./chunk-ZQHGIOYP.mjs';import {a as a$8}from'./chunk-LRRENTT5.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-DBZSN4WP.mjs';import {d,b,a as a$3,c}from'./chunk-ZJYULEER.mjs';import {jsx}from'react/jsx-runtime';import {useState,useEffect}from'react';var W=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],Y=({categories:p=W,adapter:o,classNames:P,unstyled:h,onSubmit:a$1=()=>{},copy:r,description:c,submitTo:s,submitOptions:i,onSubmitError:f,onSubmitSuccess:R})=>{var e;let d$1=n=>d(null,null,function*(){var u,N;if(s){let C=typeof(i==null?void 0:i.headers)=="function"?i.headers():(u=i==null?void 0:i.headers)!=null?u:{};try{let A=yield fetch(s,{method:"POST",headers:a$3({"Content-Type":"application/json"},C),credentials:(N=i==null?void 0:i.credentials)!=null?N:"same-origin",body:JSON.stringify(n)});if(!A.ok)f==null||f({response:A});else if(R){let v;try{let D=yield A.clone().text();D&&(v=JSON.parse(D));}catch(D){}R({response:A,data:n,body:v});}}catch(A){f==null||f({error:A});}}else o&&o.save(n);a$1(n);}),t=(e=r==null?void 0:r.description)!=null?e:c;return jsx(a,{categories:p,onSubmit:d$1,classNames:P,unstyled:h,title:r==null?void 0:r.title,description:t,submitButtonText:r==null?void 0:r.submitButton})};var j=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}];function J(p,o){let P=[],h=s=>{let i=o[s.id];if(i!=null&&s.riskLevel)if(["select","radio","checkbox"].includes(s.type)&&s.options)(Array.isArray(i)?i:[i]).forEach(R=>{var t;let d=(t=s.options)==null?void 0:t.find(e=>e.value===R);if(d!=null&&d.riskLevel){let e=d.riskLevel,n=e==="low"?1:e==="medium"?3:5,u=e==="low"?1:e==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:`${s.text} - ${d.label}`,likelihood:n,impact:u,score:n*u,level:e,mitigated:false,relatedQuestionIds:[s.id]});}});else {let f=s.riskLevel,R=f==="low"?1:f==="medium"?3:5,d=f==="low"?1:f==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:s.text,likelihood:R,impact:d,score:R*d,level:f,mitigated:false,relatedQuestionIds:[s.id]});}};p.forEach(s=>s.questions.forEach(h));let a=Date.now(),r={id:`dpia_${a}`,title:"",processingDescription:"",startedAt:a,completedAt:a,assessor:{name:"",role:"",email:""},answers:o,risks:P,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},c=a$8(r);return r.overallRiskLevel=c.overallRiskLevel,r.canProceed=c.canProceed,r.conclusion=c.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",r.recommendations=c.recommendations,r}var V=({sections:p=j,adapter:o,classNames:P,unstyled:h,onResult:a,copy:r,submitTo:c,submitOptions:s,onSubmitError:i,onSubmitSuccess:f})=>{let[R,d$1]=useState({}),[t,e]=useState(0),n=(v,D)=>{d$1(w=>b(a$3({},w),{[v]:D}));},u=v=>d(null,null,function*(){var D,w;if(c){let q=typeof(s==null?void 0:s.headers)=="function"?s.headers():(D=s==null?void 0:s.headers)!=null?D:{};try{let y=yield fetch(c,{method:"POST",headers:a$3({"Content-Type":"application/json"},q),credentials:(w=s==null?void 0:s.credentials)!=null?w:"same-origin",body:JSON.stringify(v)});if(!y.ok)i==null||i({response:y});else if(f){let x;try{let B=yield y.clone().text();B&&(x=JSON.parse(B));}catch(B){}f({response:y,data:v,body:x});}}catch(y){i==null||i({error:y});}}else o&&o.save(v);a==null||a(J(p,v));}),N=()=>{t<p.length-1?e(v=>v+1):u(R);},C=()=>{t>0&&e(v=>v-1);},A=Math.round((t+1)/p.length*100);return jsx(a$1,{sections:p,answers:R,onAnswerChange:n,currentSectionIndex:t,onNextSection:N,onPrevSection:C,progress:A,classNames:P,unstyled:h,submitButtonText:r==null?void 0:r.submitButton,nextButtonText:r==null?void 0:r.nextButton,prevButtonText:r==null?void 0:r.prevButton})};var X=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let r=p!=null?p:[],[c,s]=useState(()=>{if(o){let t=o.load();if(t&&!(t instanceof Promise))return t}return r});useEffect(()=>{if(!o)return;let t=false;return d(null,null,function*(){try{let e=yield o.load();!t&&e&&s(e);}catch(e){}}),()=>{t=true;}},[o]);let i=t=>{o&&o.save(t);};return jsx(a$2,{activities:c,onAdd:t=>{let e=Date.now(),n=b(a$3({},t),{id:`activity-${e}`,createdAt:e,updatedAt:e}),u=[...c,n];s(u),i(u);},onUpdate:(t,e)=>{let n=c.map(u=>u.id===t?b(a$3(a$3({},u),e),{updatedAt:Date.now()}):u);s(n),i(n);},onArchive:t=>{let e=c.map(n=>n.id===t?b(a$3({},n),{status:"inactive",updatedAt:Date.now()}):n);s(e),i(e);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var te=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let r=p!=null?p:[],[c,s]=useState(()=>{if(o){let t=o.load();if(t&&!(t instanceof Promise))return t}return r});useEffect(()=>{if(!o)return;let t=false;return d(null,null,function*(){try{let e=yield o.load();!t&&e&&s(e);}catch(e){}}),()=>{t=true;}},[o]);let i=t=>{o&&o.save(t);};return jsx(a$4,{transfers:c,onAdd:t=>{let e=Date.now(),n=b(a$3({},t),{id:`transfer-${e}`,createdAt:e,updatedAt:e}),u=[...c,n];s(u),i(u);},onUpdate:(t,e)=>{let n=c.map(u=>u.id===t?b(a$3(a$3({},u),e),{updatedAt:Date.now()}):u);s(n),i(n);},onArchive:t=>{let e=c.filter(n=>n.id!==t);s(e),i(e);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var ae={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},ie=({initialData:p,adapter:o,classNames:P,unstyled:h,copy:a})=>{let[r,c]=useState(p!=null?p:ae);useEffect(()=>{if(!o)return;let d$1=false;return d(null,null,function*(){let e=yield o.load();!d$1&&e&&c(e);}),()=>{d$1=true;}},[o]);let s=d=>{o&&o.save(d);};return jsx(a$5,{ropa:r,onAdd:d=>{let t=b(a$3({},r),{records:[...r.records,d],lastUpdated:Date.now()});c(t),s(t);},onUpdate:(d,t)=>{let e=b(a$3({},r),{records:r.records.map(n=>n.id===d?b(a$3(a$3({},n),t),{updatedAt:Date.now()}):n),lastUpdated:Date.now()});c(e),s(e);},onArchive:d=>{let t=b(a$3({},r),{records:r.records.map(e=>e.id===d?b(a$3({},e),{status:"archived",updatedAt:Date.now()}):e),lastUpdated:Date.now()});c(t),s(t);},classNames:P,unstyled:h,title:a==null?void 0:a.title,description:a==null?void 0:a.description})};var de=P=>{var h=P,{input:p}=h,o=c(h,["input"]);let a=a$6(p);return jsx(a$7,a$3({report:a},o))};export{Y as NDPRBreachReport,de as NDPRComplianceDashboard,te as NDPRCrossBorder,V as NDPRDPIA,X as NDPRLawfulBasis,ie as NDPRROPA};
@@ -176,18 +176,9 @@ export declare interface ROPAManagerLiteClassNames {
176
176
 
177
177
  export declare interface ROPAManagerLiteProps {
178
178
  /**
179
- * Flat list of processing records.
180
- * @deprecated Use `ropa` (4.1+) to pass the full
181
- * `RecordOfProcessingActivities` object, matching the full
182
- * `ROPAManager` API. The `records` prop will be removed in 5.0.
179
+ * Full Record of Processing Activities — matches the full `ROPAManager` API.
183
180
  */
184
- records?: ProcessingRecord[];
185
- /**
186
- * Full Record of Processing Activities (4.1+). Takes precedence over
187
- * `records` when both are provided. This will become the canonical
188
- * shape in 5.0.
189
- */
190
- ropa?: RecordOfProcessingActivities;
181
+ ropa: RecordOfProcessingActivities;
191
182
  title?: string;
192
183
  description?: string;
193
184
  className?: string;
@@ -176,18 +176,9 @@ export declare interface ROPAManagerLiteClassNames {
176
176
 
177
177
  export declare interface ROPAManagerLiteProps {
178
178
  /**
179
- * Flat list of processing records.
180
- * @deprecated Use `ropa` (4.1+) to pass the full
181
- * `RecordOfProcessingActivities` object, matching the full
182
- * `ROPAManager` API. The `records` prop will be removed in 5.0.
179
+ * Full Record of Processing Activities — matches the full `ROPAManager` API.
183
180
  */
184
- records?: ProcessingRecord[];
185
- /**
186
- * Full Record of Processing Activities (4.1+). Takes precedence over
187
- * `records` when both are provided. This will become the canonical
188
- * shape in 5.0.
189
- */
190
- ropa?: RecordOfProcessingActivities;
181
+ ropa: RecordOfProcessingActivities;
191
182
  title?: string;
192
183
  description?: string;
193
184
  className?: string;
package/dist/ropa-lite.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- 'use strict';var chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js');require('./chunk-TTMGFC6C.js'),require('./chunk-RFPLZDIO.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var D={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},G=["consent","contract","legal_obligation","vital_interests","public_interest","legitimate_interests"],I={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},E={active:"Active",inactive:"Inactive",archived:"Archived"};function $(n){return n?new Date(n).toLocaleDateString():"N/A"}function T(n){return !!n.nextReviewDate&&n.nextReviewDate<=Date.now()}var F=({records:n,ropa:p,title:_,description:x,className:O="",classNames:t,unstyled:d,showSummary:S=true,showComplianceGaps:k=true,onRecordClick:c})=>{var w,P;let A=chunkYDKWD6MQ_js.c(),B=(w=_!=null?_:A.ropa.title)!=null?w:"Record of Processing Activities (ROPA)",N=(P=x!=null?x:A.ropa.description)!=null?P:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",h=react.useRef(false);react.useEffect(()=>{process.env.NODE_ENV==="production"||h.current||n!==void 0&&p===void 0&&(h.current=true,console.warn("[ndpr-toolkit/ropa] ROPAManagerLite `records` is deprecated; pass the full `ropa` object instead. Will be removed in 5.0."));},[n,p]);let b=react.useMemo(()=>p?p.records:n!=null?n:[],[p,n]),f=react.useMemo(()=>p!=null?p:{id:"lite",organizationName:"",organizationContact:"",organizationAddress:"",records:b,lastUpdated:0,version:"0"},[p,b]),s=react.useMemo(()=>chunk4CVBQC66_js.b(f),[f]),u=react.useMemo(()=>chunk4CVBQC66_js.d(f),[f]);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${O}`,t==null?void 0:t.root,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",t==null?void 0:t.header,d),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.title,d),children:B}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:N})]}),S&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",t==null?void 0:t.summary,d),children:[jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[["p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center","ndpr-text-info","Total Records",s.totalRecords,false],["p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center","ndpr-text-success","Active",s.activeRecords,false],["p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center","ndpr-text-info","Cross-Border",s.crossBorderRecords,false],["p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center","ndpr-text-warning","Records with Gaps",u.length,true]].map(([r,o,l,g,m])=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(r,t==null?void 0:t.summaryCard,d),children:[jsxRuntime.jsx("p",{className:m?chunkAME4HJR4_js.a(`ndpr-stat__value ${o}`,t==null?void 0:t.complianceScore,d):`ndpr-stat__value ${o}`,children:g}),jsxRuntime.jsx("p",{className:`text-xs ${o}`,children:l})]},l))}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),G.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:D[r]}),jsxRuntime.jsx("span",{className:"font-medium",children:s.byLawfulBasis[r]||0})]},r))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),[["Sensitive Data",s.sensitiveDataRecords,false],["DPIA Required",s.dpiaRequiredRecords,false],["Automated Decisions",s.automatedDecisionRecords,false],["Due for Review",s.recordsDueForReview.length,s.recordsDueForReview.length>0]].map(([r,o,l])=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r}),jsxRuntime.jsx("span",{className:`font-medium ${l?"ndpr-text-destructive":""}`,children:o})]},r))]}),s.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),s.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]})]}),k&&u.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md mb-6",t==null?void 0:t.gapAlert,d),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),u.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((o,l)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:o},l))})]},r.recordId)),u.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",u.length-5," more record(s) with gaps."]})]}),b.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-sm text-left",t==null?void 0:t.table,d),children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-table__head",t==null?void 0:t.tableHeader,d),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Retention"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"})]})}),jsxRuntime.jsx("tbody",{children:b.map(r=>{let o=T(r),l=u.some(m=>m.recordId===r.id),g=!!c;return jsxRuntime.jsxs("tr",{onClick:g?()=>c==null?void 0:c(r):void 0,role:g?"button":void 0,tabIndex:g?0:void 0,onKeyDown:g?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),c==null||c(r));}:void 0,className:chunkAME4HJR4_js.a(`border-b dark:border-gray-600 ${o?"bg-red-50 dark:bg-red-900/10":l?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} ${g?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,t==null?void 0:t.tableRow,d),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),o&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:D[r.lawfulBasis]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:r.retentionPeriod||"N/A"}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${I[r.status]}`,t==null?void 0:t.statusBadge,d),children:E[r.status]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:$(r.lastReviewedAt)})]},r.id)})})]})})]})};Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});exports.ROPAManagerLite=F;
2
+ 'use strict';var chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js');require('./chunk-TTMGFC6C.js'),require('./chunk-RFPLZDIO.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var w={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},B=["consent","contract","legal_obligation","vital_interests","public_interest","legitimate_interests"],k={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},N={active:"Active",inactive:"Inactive",archived:"Archived"};function C(i){return i?new Date(i).toLocaleDateString():"N/A"}function G(i){return !!i.nextReviewDate&&i.nextReviewDate<=Date.now()}var I=({ropa:i,title:u,description:b,className:P="",classNames:t,unstyled:d,showSummary:L=true,showComplianceGaps:D=true,onRecordClick:l})=>{var R,y;let _=chunkYDKWD6MQ_js.c(),O=(R=u!=null?u:_.ropa.title)!=null?R:"Record of Processing Activities (ROPA)",S=(y=b!=null?b:_.ropa.description)!=null?y:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",x=i.records,s=react.useMemo(()=>chunk4CVBQC66_js.b(i),[i]),g=react.useMemo(()=>chunk4CVBQC66_js.d(i),[i]);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${P}`,t==null?void 0:t.root,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",t==null?void 0:t.header,d),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.title,d),children:O}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:S})]}),L&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",t==null?void 0:t.summary,d),children:[jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[["p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center","ndpr-text-info","Total Records",s.totalRecords,false],["p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center","ndpr-text-success","Active",s.activeRecords,false],["p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center","ndpr-text-info","Cross-Border",s.crossBorderRecords,false],["p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center","ndpr-text-warning","Records with Gaps",g.length,true]].map(([r,o,p,c,m])=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(r,t==null?void 0:t.summaryCard,d),children:[jsxRuntime.jsx("p",{className:m?chunkAME4HJR4_js.a(`ndpr-stat__value ${o}`,t==null?void 0:t.complianceScore,d):`ndpr-stat__value ${o}`,children:c}),jsxRuntime.jsx("p",{className:`text-xs ${o}`,children:p})]},p))}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),B.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:w[r]}),jsxRuntime.jsx("span",{className:"font-medium",children:s.byLawfulBasis[r]||0})]},r))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),[["Sensitive Data",s.sensitiveDataRecords,false],["DPIA Required",s.dpiaRequiredRecords,false],["Automated Decisions",s.automatedDecisionRecords,false],["Due for Review",s.recordsDueForReview.length,s.recordsDueForReview.length>0]].map(([r,o,p])=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r}),jsxRuntime.jsx("span",{className:`font-medium ${p?"ndpr-text-destructive":""}`,children:o})]},r))]}),s.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),s.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]})]}),D&&g.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md mb-6",t==null?void 0:t.gapAlert,d),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),g.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((o,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:o},p))})]},r.recordId)),g.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",g.length-5," more record(s) with gaps."]})]}),x.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-sm text-left",t==null?void 0:t.table,d),children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-table__head",t==null?void 0:t.tableHeader,d),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Retention"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"})]})}),jsxRuntime.jsx("tbody",{children:x.map(r=>{let o=G(r),p=g.some(m=>m.recordId===r.id),c=!!l;return jsxRuntime.jsxs("tr",{onClick:c?()=>l==null?void 0:l(r):void 0,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l==null||l(r));}:void 0,className:chunkAME4HJR4_js.a(`border-b dark:border-gray-600 ${o?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} ${c?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,t==null?void 0:t.tableRow,d),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),o&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:w[r.lawfulBasis]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:r.retentionPeriod||"N/A"}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${k[r.status]}`,t==null?void 0:t.statusBadge,d),children:N[r.status]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:C(r.lastReviewedAt)})]},r.id)})})]})})]})};Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});exports.ROPAManagerLite=I;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import {b,d}from'./chunk-XP5PL6K7.mjs';export{b as generateROPASummary,d as identifyComplianceGaps}from'./chunk-XP5PL6K7.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-ZJYULEER.mjs';import {useRef,useEffect,useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var D={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},G=["consent","contract","legal_obligation","vital_interests","public_interest","legitimate_interests"],I={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},E={active:"Active",inactive:"Inactive",archived:"Archived"};function $(n){return n?new Date(n).toLocaleDateString():"N/A"}function T(n){return !!n.nextReviewDate&&n.nextReviewDate<=Date.now()}var F=({records:n,ropa:p,title:_,description:x,className:O="",classNames:t,unstyled:d$1,showSummary:S=true,showComplianceGaps:k=true,onRecordClick:c$1})=>{var w,P;let A=c(),B=(w=_!=null?_:A.ropa.title)!=null?w:"Record of Processing Activities (ROPA)",N=(P=x!=null?x:A.ropa.description)!=null?P:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",h=useRef(false);useEffect(()=>{process.env.NODE_ENV==="production"||h.current||n!==void 0&&p===void 0&&(h.current=true,console.warn("[ndpr-toolkit/ropa] ROPAManagerLite `records` is deprecated; pass the full `ropa` object instead. Will be removed in 5.0."));},[n,p]);let b$1=useMemo(()=>p?p.records:n!=null?n:[],[p,n]),f=useMemo(()=>p!=null?p:{id:"lite",organizationName:"",organizationContact:"",organizationAddress:"",records:b$1,lastUpdated:0,version:"0"},[p,b$1]),s=useMemo(()=>b(f),[f]),u=useMemo(()=>d(f),[f]);return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${O}`,t==null?void 0:t.root,d$1),children:[jsxs("div",{className:a("",t==null?void 0:t.header,d$1),children:[jsx("h2",{className:a("ndpr-section-heading",t==null?void 0:t.title,d$1),children:B}),jsx("p",{className:"ndpr-card__subtitle",children:N})]}),S&&jsxs("div",{className:a("mb-6",t==null?void 0:t.summary,d$1),children:[jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[["p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center","ndpr-text-info","Total Records",s.totalRecords,false],["p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center","ndpr-text-success","Active",s.activeRecords,false],["p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center","ndpr-text-info","Cross-Border",s.crossBorderRecords,false],["p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center","ndpr-text-warning","Records with Gaps",u.length,true]].map(([r,o,l,g,m])=>jsxs("div",{className:a(r,t==null?void 0:t.summaryCard,d$1),children:[jsx("p",{className:m?a(`ndpr-stat__value ${o}`,t==null?void 0:t.complianceScore,d$1):`ndpr-stat__value ${o}`,children:g}),jsx("p",{className:`text-xs ${o}`,children:l})]},l))}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),G.map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:D[r]}),jsx("span",{className:"font-medium",children:s.byLawfulBasis[r]||0})]},r))]}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),[["Sensitive Data",s.sensitiveDataRecords,false],["DPIA Required",s.dpiaRequiredRecords,false],["Automated Decisions",s.automatedDecisionRecords,false],["Due for Review",s.recordsDueForReview.length,s.recordsDueForReview.length>0]].map(([r,o,l])=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r}),jsx("span",{className:`font-medium ${l?"ndpr-text-destructive":""}`,children:o})]},r))]}),s.topDepartments.length>0&&jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),s.topDepartments.slice(0,5).map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]})]}),k&&u.length>0&&jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md mb-6",t==null?void 0:t.gapAlert,d$1),role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),u.slice(0,5).map(r=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((o,l)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:o},l))})]},r.recordId)),u.length>5&&jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",u.length-5," more record(s) with gaps."]})]}),b$1.length===0?jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-sm text-left",t==null?void 0:t.table,d$1),children:[jsx("thead",{className:a("ndpr-table__head",t==null?void 0:t.tableHeader,d$1),children:jsxs("tr",{children:[jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsx("th",{className:"ndpr-table__cell",children:"Retention"}),jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"})]})}),jsx("tbody",{children:b$1.map(r=>{let o=T(r),l=u.some(m=>m.recordId===r.id),g=!!c$1;return jsxs("tr",{onClick:g?()=>c$1==null?void 0:c$1(r):void 0,role:g?"button":void 0,tabIndex:g?0:void 0,onKeyDown:g?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),c$1==null||c$1(r));}:void 0,className:a(`border-b dark:border-gray-600 ${o?"bg-red-50 dark:bg-red-900/10":l?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} ${g?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,t==null?void 0:t.tableRow,d$1),children:[jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:r.name}),r.department&&jsx("p",{className:"ndpr-form-field__hint",children:r.department}),o&&jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"ndpr-table__cell",children:jsx("span",{className:"ndpr-badge ndpr-badge--info",children:D[r.lawfulBasis]})}),jsx("td",{className:"ndpr-table__cell",children:jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:r.retentionPeriod||"N/A"}),jsx("td",{className:"ndpr-table__cell",children:jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${I[r.status]}`,t==null?void 0:t.statusBadge,d$1),children:E[r.status]})}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:$(r.lastReviewedAt)})]},r.id)})})]})})]})};export{F as ROPAManagerLite};
2
+ import {b,d}from'./chunk-XP5PL6K7.mjs';export{b as generateROPASummary,d as identifyComplianceGaps}from'./chunk-XP5PL6K7.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-ZJYULEER.mjs';import {useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var w={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},B=["consent","contract","legal_obligation","vital_interests","public_interest","legitimate_interests"],k={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},N={active:"Active",inactive:"Inactive",archived:"Archived"};function C(i){return i?new Date(i).toLocaleDateString():"N/A"}function G(i){return !!i.nextReviewDate&&i.nextReviewDate<=Date.now()}var I=({ropa:i,title:u,description:b$1,className:P="",classNames:t,unstyled:d$1,showSummary:L=true,showComplianceGaps:D=true,onRecordClick:l})=>{var R,y;let _=c(),O=(R=u!=null?u:_.ropa.title)!=null?R:"Record of Processing Activities (ROPA)",S=(y=b$1!=null?b$1:_.ropa.description)!=null?y:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",x=i.records,s=useMemo(()=>b(i),[i]),g=useMemo(()=>d(i),[i]);return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${P}`,t==null?void 0:t.root,d$1),children:[jsxs("div",{className:a("",t==null?void 0:t.header,d$1),children:[jsx("h2",{className:a("ndpr-section-heading",t==null?void 0:t.title,d$1),children:O}),jsx("p",{className:"ndpr-card__subtitle",children:S})]}),L&&jsxs("div",{className:a("mb-6",t==null?void 0:t.summary,d$1),children:[jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[["p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center","ndpr-text-info","Total Records",s.totalRecords,false],["p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center","ndpr-text-success","Active",s.activeRecords,false],["p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center","ndpr-text-info","Cross-Border",s.crossBorderRecords,false],["p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center","ndpr-text-warning","Records with Gaps",g.length,true]].map(([r,o,p,c,m])=>jsxs("div",{className:a(r,t==null?void 0:t.summaryCard,d$1),children:[jsx("p",{className:m?a(`ndpr-stat__value ${o}`,t==null?void 0:t.complianceScore,d$1):`ndpr-stat__value ${o}`,children:c}),jsx("p",{className:`text-xs ${o}`,children:p})]},p))}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),B.map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:w[r]}),jsx("span",{className:"font-medium",children:s.byLawfulBasis[r]||0})]},r))]}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),[["Sensitive Data",s.sensitiveDataRecords,false],["DPIA Required",s.dpiaRequiredRecords,false],["Automated Decisions",s.automatedDecisionRecords,false],["Due for Review",s.recordsDueForReview.length,s.recordsDueForReview.length>0]].map(([r,o,p])=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r}),jsx("span",{className:`font-medium ${p?"ndpr-text-destructive":""}`,children:o})]},r))]}),s.topDepartments.length>0&&jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),s.topDepartments.slice(0,5).map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]})]}),D&&g.length>0&&jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md mb-6",t==null?void 0:t.gapAlert,d$1),role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),g.slice(0,5).map(r=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((o,p)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:o},p))})]},r.recordId)),g.length>5&&jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",g.length-5," more record(s) with gaps."]})]}),x.length===0?jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-sm text-left",t==null?void 0:t.table,d$1),children:[jsx("thead",{className:a("ndpr-table__head",t==null?void 0:t.tableHeader,d$1),children:jsxs("tr",{children:[jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsx("th",{className:"ndpr-table__cell",children:"Retention"}),jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"})]})}),jsx("tbody",{children:x.map(r=>{let o=G(r),p=g.some(m=>m.recordId===r.id),c=!!l;return jsxs("tr",{onClick:c?()=>l==null?void 0:l(r):void 0,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l==null||l(r));}:void 0,className:a(`border-b dark:border-gray-600 ${o?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} ${c?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,t==null?void 0:t.tableRow,d$1),children:[jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:r.name}),r.department&&jsx("p",{className:"ndpr-form-field__hint",children:r.department}),o&&jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"ndpr-table__cell",children:jsx("span",{className:"ndpr-badge ndpr-badge--info",children:w[r.lawfulBasis]})}),jsx("td",{className:"ndpr-table__cell",children:jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:r.retentionPeriod||"N/A"}),jsx("td",{className:"ndpr-table__cell",children:jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${k[r.status]}`,t==null?void 0:t.statusBadge,d$1),children:N[r.status]})}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:C(r.lastReviewedAt)})]},r.id)})})]})})]})};export{I as ROPAManagerLite};
package/dist/ropa.d.mts CHANGED
@@ -211,36 +211,15 @@ declare interface ROPAManagerProps {
211
211
  */
212
212
  ropa: RecordOfProcessingActivities;
213
213
  /**
214
- * Callback when a new record is added
215
- * @deprecated Renamed to `onAdd` in 4.1. The legacy name still fires
216
- * for backward compatibility and will be removed in 5.0.
217
- */
218
- onAddRecord?: (record: ProcessingRecord) => void;
219
- /**
220
- * Callback when a record is updated
221
- * @deprecated Renamed to `onUpdate` in 4.1. The legacy name still fires
222
- * for backward compatibility and will be removed in 5.0.
223
- */
224
- onUpdateRecord?: (id: string, updates: Partial<ProcessingRecord>) => void;
225
- /**
226
- * Callback when a record is archived
227
- * @deprecated Renamed to `onArchive` in 4.1. The legacy name still fires
228
- * for backward compatibility and will be removed in 5.0.
229
- */
230
- onArchiveRecord?: (id: string) => void;
231
- /**
232
- * Callback when a new record is added (uniform 4.1+ name).
233
- * Takes precedence over `onAddRecord` when both are provided.
214
+ * Callback when a new record is added.
234
215
  */
235
216
  onAdd?: (record: ProcessingRecord) => void;
236
217
  /**
237
- * Callback when a record is updated (uniform 4.1+ name).
238
- * Takes precedence over `onUpdateRecord` when both are provided.
218
+ * Callback when a record is updated.
239
219
  */
240
220
  onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
241
221
  /**
242
- * Callback when a record is archived (uniform 4.1+ name).
243
- * Takes precedence over `onArchiveRecord` when both are provided.
222
+ * Callback when a record is archived.
244
223
  */
245
224
  onArchive?: (id: string) => void;
246
225
  /**
@@ -278,9 +257,9 @@ export declare const ROPAProvider: React__default.FC<ROPAProviderProps>;
278
257
  export declare interface ROPAProviderProps {
279
258
  initialData: RecordOfProcessingActivities;
280
259
  adapter?: StorageAdapter<RecordOfProcessingActivities>;
281
- onRecordAdd?: (record: ProcessingRecord) => void;
282
- onRecordUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
283
- onRecordArchive?: (id: string) => void;
260
+ onAdd?: (record: ProcessingRecord) => void;
261
+ onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
262
+ onArchive?: (id: string) => void;
284
263
  children: React__default.ReactNode;
285
264
  }
286
265
 
@@ -352,7 +331,7 @@ export declare interface StorageAdapter<T = unknown> {
352
331
  * }
353
332
  * ```
354
333
  */
355
- export declare function useROPA({ initialData, adapter, onRecordAdd, onRecordUpdate, onRecordArchive, onAdd, onUpdate, onArchive, }: UseROPAOptions): UseROPAReturn;
334
+ export declare function useROPA({ initialData, adapter, onAdd, onUpdate, onArchive, }: UseROPAOptions): UseROPAReturn;
356
335
 
357
336
  export declare function useROPACompound(): ROPAContextValue;
358
337
 
@@ -368,36 +347,15 @@ export declare interface UseROPAOptions {
368
347
  */
369
348
  adapter?: StorageAdapter<RecordOfProcessingActivities>;
370
349
  /**
371
- * Callback when a record is added
372
- * @deprecated Renamed to `onAdd` in 4.1. The legacy name still fires
373
- * for backward compatibility and will be removed in 5.0.
374
- */
375
- onRecordAdd?: (record: ProcessingRecord) => void;
376
- /**
377
- * Callback when a record is updated
378
- * @deprecated Renamed to `onUpdate` in 4.1. The legacy name still fires
379
- * for backward compatibility and will be removed in 5.0.
380
- */
381
- onRecordUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
382
- /**
383
- * Callback when a record is archived
384
- * @deprecated Renamed to `onArchive` in 4.1. The legacy name still fires
385
- * for backward compatibility and will be removed in 5.0.
386
- */
387
- onRecordArchive?: (id: string) => void;
388
- /**
389
- * Callback when a record is added (uniform 4.1+ name).
390
- * Takes precedence over `onRecordAdd` when both are provided.
350
+ * Callback when a record is added.
391
351
  */
392
352
  onAdd?: (record: ProcessingRecord) => void;
393
353
  /**
394
- * Callback when a record is updated (uniform 4.1+ name).
395
- * Takes precedence over `onRecordUpdate` when both are provided.
354
+ * Callback when a record is updated.
396
355
  */
397
356
  onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
398
357
  /**
399
- * Callback when a record is archived (uniform 4.1+ name).
400
- * Takes precedence over `onRecordArchive` when both are provided.
358
+ * Callback when a record is archived.
401
359
  */
402
360
  onArchive?: (id: string) => void;
403
361
  }
package/dist/ropa.d.ts CHANGED
@@ -211,36 +211,15 @@ declare interface ROPAManagerProps {
211
211
  */
212
212
  ropa: RecordOfProcessingActivities;
213
213
  /**
214
- * Callback when a new record is added
215
- * @deprecated Renamed to `onAdd` in 4.1. The legacy name still fires
216
- * for backward compatibility and will be removed in 5.0.
217
- */
218
- onAddRecord?: (record: ProcessingRecord) => void;
219
- /**
220
- * Callback when a record is updated
221
- * @deprecated Renamed to `onUpdate` in 4.1. The legacy name still fires
222
- * for backward compatibility and will be removed in 5.0.
223
- */
224
- onUpdateRecord?: (id: string, updates: Partial<ProcessingRecord>) => void;
225
- /**
226
- * Callback when a record is archived
227
- * @deprecated Renamed to `onArchive` in 4.1. The legacy name still fires
228
- * for backward compatibility and will be removed in 5.0.
229
- */
230
- onArchiveRecord?: (id: string) => void;
231
- /**
232
- * Callback when a new record is added (uniform 4.1+ name).
233
- * Takes precedence over `onAddRecord` when both are provided.
214
+ * Callback when a new record is added.
234
215
  */
235
216
  onAdd?: (record: ProcessingRecord) => void;
236
217
  /**
237
- * Callback when a record is updated (uniform 4.1+ name).
238
- * Takes precedence over `onUpdateRecord` when both are provided.
218
+ * Callback when a record is updated.
239
219
  */
240
220
  onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
241
221
  /**
242
- * Callback when a record is archived (uniform 4.1+ name).
243
- * Takes precedence over `onArchiveRecord` when both are provided.
222
+ * Callback when a record is archived.
244
223
  */
245
224
  onArchive?: (id: string) => void;
246
225
  /**
@@ -278,9 +257,9 @@ export declare const ROPAProvider: React__default.FC<ROPAProviderProps>;
278
257
  export declare interface ROPAProviderProps {
279
258
  initialData: RecordOfProcessingActivities;
280
259
  adapter?: StorageAdapter<RecordOfProcessingActivities>;
281
- onRecordAdd?: (record: ProcessingRecord) => void;
282
- onRecordUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
283
- onRecordArchive?: (id: string) => void;
260
+ onAdd?: (record: ProcessingRecord) => void;
261
+ onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
262
+ onArchive?: (id: string) => void;
284
263
  children: React__default.ReactNode;
285
264
  }
286
265
 
@@ -352,7 +331,7 @@ export declare interface StorageAdapter<T = unknown> {
352
331
  * }
353
332
  * ```
354
333
  */
355
- export declare function useROPA({ initialData, adapter, onRecordAdd, onRecordUpdate, onRecordArchive, onAdd, onUpdate, onArchive, }: UseROPAOptions): UseROPAReturn;
334
+ export declare function useROPA({ initialData, adapter, onAdd, onUpdate, onArchive, }: UseROPAOptions): UseROPAReturn;
356
335
 
357
336
  export declare function useROPACompound(): ROPAContextValue;
358
337
 
@@ -368,36 +347,15 @@ export declare interface UseROPAOptions {
368
347
  */
369
348
  adapter?: StorageAdapter<RecordOfProcessingActivities>;
370
349
  /**
371
- * Callback when a record is added
372
- * @deprecated Renamed to `onAdd` in 4.1. The legacy name still fires
373
- * for backward compatibility and will be removed in 5.0.
374
- */
375
- onRecordAdd?: (record: ProcessingRecord) => void;
376
- /**
377
- * Callback when a record is updated
378
- * @deprecated Renamed to `onUpdate` in 4.1. The legacy name still fires
379
- * for backward compatibility and will be removed in 5.0.
380
- */
381
- onRecordUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
382
- /**
383
- * Callback when a record is archived
384
- * @deprecated Renamed to `onArchive` in 4.1. The legacy name still fires
385
- * for backward compatibility and will be removed in 5.0.
386
- */
387
- onRecordArchive?: (id: string) => void;
388
- /**
389
- * Callback when a record is added (uniform 4.1+ name).
390
- * Takes precedence over `onRecordAdd` when both are provided.
350
+ * Callback when a record is added.
391
351
  */
392
352
  onAdd?: (record: ProcessingRecord) => void;
393
353
  /**
394
- * Callback when a record is updated (uniform 4.1+ name).
395
- * Takes precedence over `onRecordUpdate` when both are provided.
354
+ * Callback when a record is updated.
396
355
  */
397
356
  onUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
398
357
  /**
399
- * Callback when a record is archived (uniform 4.1+ name).
400
- * Takes precedence over `onRecordArchive` when both are provided.
358
+ * Callback when a record is archived.
401
359
  */
402
360
  onArchive?: (id: string) => void;
403
361
  }
package/dist/ropa.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- 'use strict';var chunkHLFS3NXG_js=require('./chunk-HLFS3NXG.js'),chunkP5MPUC5F_js=require('./chunk-P5MPUC5F.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js');require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-RFPLZDIO.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var t=react.createContext(null);function u(){let r=react.useContext(t);if(!r)throw new Error("ROPA compound components must be wrapped in <ROPA.Provider>. Example: <ROPA.Provider initialData={...}><ROPA.Manager /></ROPA.Provider>");return r}var p=({initialData:r,adapter:i,onRecordAdd:P,onRecordUpdate:n,onRecordArchive:a,children:s})=>{let R=chunkP5MPUC5F_js.a({initialData:r,adapter:i,onRecordAdd:P,onRecordUpdate:n,onRecordArchive:a});return jsxRuntime.jsx(t.Provider,{value:R,children:s})};var v={Provider:p,Manager:chunkHLFS3NXG_js.a};Object.defineProperty(exports,"ROPAManager",{enumerable:true,get:function(){return chunkHLFS3NXG_js.a}});Object.defineProperty(exports,"useROPA",{enumerable:true,get:function(){return chunkP5MPUC5F_js.a}});Object.defineProperty(exports,"exportROPAToCSV",{enumerable:true,get:function(){return chunk4CVBQC66_js.c}});Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});Object.defineProperty(exports,"validateProcessingRecord",{enumerable:true,get:function(){return chunk4CVBQC66_js.a}});exports.ROPA=v;exports.ROPAProvider=p;exports.useROPACompound=u;
2
+ 'use strict';var chunkMAD7QYRK_js=require('./chunk-MAD7QYRK.js'),chunkTLIHFGIJ_js=require('./chunk-TLIHFGIJ.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js');require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-RFPLZDIO.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var t=react.createContext(null);function u(){let r=react.useContext(t);if(!r)throw new Error("ROPA compound components must be wrapped in <ROPA.Provider>. Example: <ROPA.Provider initialData={...}><ROPA.Manager /></ROPA.Provider>");return r}var p=({initialData:r,adapter:i,onAdd:P,onUpdate:n,onArchive:a,children:s})=>{let R=chunkTLIHFGIJ_js.a({initialData:r,adapter:i,onAdd:P,onUpdate:n,onArchive:a});return jsxRuntime.jsx(t.Provider,{value:R,children:s})};var v={Provider:p,Manager:chunkMAD7QYRK_js.a};Object.defineProperty(exports,"ROPAManager",{enumerable:true,get:function(){return chunkMAD7QYRK_js.a}});Object.defineProperty(exports,"useROPA",{enumerable:true,get:function(){return chunkTLIHFGIJ_js.a}});Object.defineProperty(exports,"exportROPAToCSV",{enumerable:true,get:function(){return chunk4CVBQC66_js.c}});Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});Object.defineProperty(exports,"validateProcessingRecord",{enumerable:true,get:function(){return chunk4CVBQC66_js.a}});exports.ROPA=v;exports.ROPAProvider=p;exports.useROPACompound=u;
package/dist/ropa.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import {a}from'./chunk-W6VVLHRQ.mjs';export{a as ROPAManager}from'./chunk-W6VVLHRQ.mjs';import {a as a$1}from'./chunk-JGY65SHX.mjs';export{a as useROPA}from'./chunk-JGY65SHX.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-ZJYULEER.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var t=createContext(null);function u(){let r=useContext(t);if(!r)throw new Error("ROPA compound components must be wrapped in <ROPA.Provider>. Example: <ROPA.Provider initialData={...}><ROPA.Manager /></ROPA.Provider>");return r}var p=({initialData:r,adapter:i,onRecordAdd:P,onRecordUpdate:n,onRecordArchive:a,children:s})=>{let R=a$1({initialData:r,adapter:i,onRecordAdd:P,onRecordUpdate:n,onRecordArchive:a});return jsx(t.Provider,{value:R,children:s})};var v={Provider:p,Manager:a};export{v as ROPA,p as ROPAProvider,u as useROPACompound};
2
+ import {a}from'./chunk-BRJKIF7E.mjs';export{a as ROPAManager}from'./chunk-BRJKIF7E.mjs';import {a as a$1}from'./chunk-FRMVSG4N.mjs';export{a as useROPA}from'./chunk-FRMVSG4N.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-ZJYULEER.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var t=createContext(null);function u(){let r=useContext(t);if(!r)throw new Error("ROPA compound components must be wrapped in <ROPA.Provider>. Example: <ROPA.Provider initialData={...}><ROPA.Manager /></ROPA.Provider>");return r}var p=({initialData:r,adapter:i,onAdd:P,onUpdate:n,onArchive:a,children:s})=>{let R=a$1({initialData:r,adapter:i,onAdd:P,onUpdate:n,onArchive:a});return jsx(t.Provider,{value:R,children:s})};var v={Provider:p,Manager:a};export{v as ROPA,p as ROPAProvider,u as useROPACompound};