@tantainnovative/ndpr-toolkit 3.10.3 → 3.10.5

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 (121) hide show
  1. package/CHANGELOG.md +256 -155
  2. package/README.md +6 -6
  3. package/dist/adapters.js +1 -1
  4. package/dist/adapters.mjs +1 -1
  5. package/dist/breach.js +1 -1
  6. package/dist/breach.mjs +1 -1
  7. package/dist/{chunk-EEQALYOY.mjs → chunk-25TNTLHJ.mjs} +1 -1
  8. package/dist/{chunk-GTYXVAJX.mjs → chunk-43OQNS2J.mjs} +3 -3
  9. package/dist/chunk-5EKQX6GM.mjs +1 -0
  10. package/dist/{chunk-W7OLQRJP.js → chunk-6GM2PBTF.js} +1 -1
  11. package/dist/{chunk-Q64735OC.js → chunk-6LJHLE6G.js} +8 -8
  12. package/dist/chunk-73BMSK67.js +1 -0
  13. package/dist/chunk-7PMPKVY3.mjs +1 -0
  14. package/dist/{chunk-EFIBHKQE.mjs → chunk-7RBO42IW.mjs} +1 -1
  15. package/dist/{chunk-RMQ7OLNY.mjs → chunk-BIJSMSUU.mjs} +8 -8
  16. package/dist/{chunk-7ZZO7GVB.js → chunk-C2KEXHRX.js} +1 -1
  17. package/dist/chunk-CNM6G5IA.js +1 -0
  18. package/dist/{chunk-UKLU6BQF.mjs → chunk-CWY2FMIC.mjs} +1 -1
  19. package/dist/{chunk-LVGT3DLT.js → chunk-D2ZKDQVL.js} +1 -1
  20. package/dist/chunk-D3DVVJCT.js +1 -0
  21. package/dist/{chunk-V3RYHNHN.js → chunk-EKNWO4DK.js} +1 -1
  22. package/dist/chunk-FMJ6ICLJ.js +1 -0
  23. package/dist/chunk-G7JKRYM5.mjs +1 -0
  24. package/dist/{chunk-R7545FP4.mjs → chunk-GEP52QFH.mjs} +1 -1
  25. package/dist/{chunk-P4LNLCSF.js → chunk-H3IULCE3.js} +1 -1
  26. package/dist/chunk-IPWX5I5P.mjs +2 -0
  27. package/dist/chunk-IVSNHT24.mjs +0 -0
  28. package/dist/{chunk-N3MQQUQP.js → chunk-JS7SYL5P.js} +0 -0
  29. package/dist/chunk-JWAN5J4Y.js +1 -0
  30. package/dist/{chunk-2MIQXECH.mjs → chunk-KE2FZH2V.mjs} +1 -1
  31. package/dist/chunk-KY6WYHWB.mjs +2 -0
  32. package/dist/chunk-MOHBL6LX.mjs +1 -0
  33. package/dist/{chunk-EFIWANHF.mjs → chunk-MTSZ7GL6.mjs} +1 -1
  34. package/dist/{chunk-Y3MKMAFQ.mjs → chunk-NBQQ2GN3.mjs} +1 -1
  35. package/dist/{chunk-UAV7V4EM.js → chunk-NDKDKDDX.js} +1 -1
  36. package/dist/{chunk-3GRGYT3P.js → chunk-NUOHT3LO.js} +1 -1
  37. package/dist/chunk-O2RDZGM2.js +2 -0
  38. package/dist/{chunk-LTPSN2SU.mjs → chunk-OLEUIYE2.mjs} +1 -1
  39. package/dist/{chunk-HXWHL4BD.js → chunk-QHW4UKGJ.js} +2 -2
  40. package/dist/chunk-R3CU7DTT.js +1 -0
  41. package/dist/{chunk-HWHBINVN.mjs → chunk-RBMLGRDN.mjs} +1 -1
  42. package/dist/{chunk-Z763UI5U.js → chunk-RC3XFXTJ.js} +1 -1
  43. package/dist/{chunk-QPRYXVH2.js → chunk-RDALAH3Y.js} +1 -1
  44. package/dist/{chunk-I3Y4LOSL.js → chunk-SSH4U4TJ.js} +3 -3
  45. package/dist/{chunk-PCU6GKBE.mjs → chunk-TAHSSITO.mjs} +1 -1
  46. package/dist/{chunk-ATFUSHC2.mjs → chunk-TDHH7GS2.mjs} +1 -1
  47. package/dist/chunk-TWJHEIQH.js +2 -0
  48. package/dist/{chunk-XS3Z4UT7.js → chunk-US2VGJ7I.js} +1 -1
  49. package/dist/{chunk-VYAL2TGT.mjs → chunk-UVXS7KRV.mjs} +1 -1
  50. package/dist/{chunk-7IFSWCQP.js → chunk-WKTKTLMF.js} +1 -1
  51. package/dist/chunk-WYH3OA5L.mjs +1 -0
  52. package/dist/{chunk-UASG46LP.mjs → chunk-XC3DLYEG.mjs} +1 -1
  53. package/dist/{chunk-TMXK4QKK.mjs → chunk-XN2UYZXH.mjs} +11 -11
  54. package/dist/{chunk-XO3VQYTL.js → chunk-YWCBI7SI.js} +11 -11
  55. package/dist/consent.js +1 -1
  56. package/dist/consent.mjs +1 -1
  57. package/dist/core.d.mts +2 -2
  58. package/dist/core.d.ts +2 -2
  59. package/dist/core.js +1 -1
  60. package/dist/core.mjs +1 -1
  61. package/dist/cross-border-lite.js +1 -1
  62. package/dist/cross-border-lite.mjs +1 -1
  63. package/dist/cross-border.d.mts +3 -3
  64. package/dist/cross-border.d.ts +3 -3
  65. package/dist/cross-border.js +1 -1
  66. package/dist/cross-border.mjs +1 -1
  67. package/dist/dpia.d.mts +3 -3
  68. package/dist/dpia.d.ts +3 -3
  69. package/dist/dsr.d.mts +1 -1
  70. package/dist/dsr.d.ts +1 -1
  71. package/dist/dsr.js +1 -1
  72. package/dist/dsr.mjs +1 -1
  73. package/dist/headless.d.mts +3 -3
  74. package/dist/headless.d.ts +3 -3
  75. package/dist/headless.js +1 -1
  76. package/dist/headless.mjs +1 -1
  77. package/dist/hooks.d.mts +3 -3
  78. package/dist/hooks.d.ts +3 -3
  79. package/dist/hooks.js +1 -1
  80. package/dist/hooks.mjs +1 -1
  81. package/dist/index.d.mts +7 -7
  82. package/dist/index.d.ts +7 -7
  83. package/dist/index.js +1 -1
  84. package/dist/index.mjs +1 -1
  85. package/dist/policy.js +1 -1
  86. package/dist/policy.mjs +1 -1
  87. package/dist/presets-consent.js +1 -1
  88. package/dist/presets-consent.mjs +1 -1
  89. package/dist/presets-dsr.js +1 -1
  90. package/dist/presets-dsr.mjs +1 -1
  91. package/dist/presets-policy.js +1 -1
  92. package/dist/presets-policy.mjs +1 -1
  93. package/dist/presets.d.mts +1 -1
  94. package/dist/presets.d.ts +1 -1
  95. package/dist/presets.js +1 -1
  96. package/dist/presets.mjs +1 -1
  97. package/dist/server.d.mts +2 -2
  98. package/dist/server.d.ts +2 -2
  99. package/dist/server.js +1 -1
  100. package/dist/server.mjs +1 -1
  101. package/dist/unstyled.d.mts +1 -1
  102. package/dist/unstyled.d.ts +1 -1
  103. package/dist/unstyled.js +1 -1
  104. package/dist/unstyled.mjs +1 -1
  105. package/package.json +4 -7
  106. package/dist/chunk-4QXTB3L6.js +0 -1
  107. package/dist/chunk-5IOC3VAW.js +0 -1
  108. package/dist/chunk-732C2EVN.js +0 -1
  109. package/dist/chunk-AOHKVFAS.mjs +0 -322
  110. package/dist/chunk-BFAX7JQA.mjs +0 -1
  111. package/dist/chunk-BRS52EDT.js +0 -1
  112. package/dist/chunk-LQTARVPU.mjs +0 -1
  113. package/dist/chunk-PL4XNCQA.mjs +0 -1
  114. package/dist/chunk-ROTLSZMV.js +0 -1
  115. package/dist/chunk-RYREGZVQ.js +0 -1
  116. package/dist/chunk-S6COXIZA.js +0 -2
  117. package/dist/chunk-U5RWJRGA.mjs +0 -1
  118. package/dist/chunk-W47OSMT6.js +0 -2
  119. package/dist/chunk-W65ZWTLD.mjs +0 -1
  120. package/dist/chunk-XJO4DH3L.mjs +0 -2
  121. package/dist/chunk-ZHFLBL63.mjs +0 -2
@@ -1,2 +0,0 @@
1
- import {a as a$2}from'./chunk-EWVK45Z3.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {a as a$1,b}from'./chunk-ZJYULEER.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var or=({categories:Me,onSubmit:$e,onValidationError:u,title:Oe="Report a Data Breach",formDescription:Le="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:ze="Submit Report",className:G="",buttonClassName:K="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:Ye=true,confirmationMessage:Ue="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:He=true,maxAttachments:x=5,maxFileSize:C=5*1024*1024,allowedFileTypes:S=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:A})=>{var Se,Ae,De,Re,we,Fe,qe,Pe,ke,Te,je;let W=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[D,J]=useState((t==null?void 0:t.title)||""),[R,Q]=useState((t==null?void 0:t.description)||""),[w,X]=useState((t==null?void 0:t.category)||""),[F,V]=useState(W(t==null?void 0:t.discoveredAt)),[q,ee]=useState(W(t==null?void 0:t.occurredAt)),[P,re]=useState(((Se=t==null?void 0:t.reporter)==null?void 0:Se.name)||""),[N,te]=useState(((Ae=t==null?void 0:t.reporter)==null?void 0:Ae.email)||""),[k,ie]=useState(((De=t==null?void 0:t.reporter)==null?void 0:De.department)||""),[T,ae]=useState(((Re=t==null?void 0:t.reporter)==null?void 0:Re.phone)||""),[ne,oe]=useState((t==null?void 0:t.affectedSystems)||[]),[Ze,se]=useState(((we=t==null?void 0:t.affectedSystems)==null?void 0:we.join(", "))||""),[j,de]=useState((t==null?void 0:t.dataTypes)||[]),[h,me]=useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[I,ce]=useState((t==null?void 0:t.approximateRecordCount)!=null?String(t.approximateRecordCount):""),[B,pe]=useState(((Fe=t==null?void 0:t.dataSubjectCategories)==null?void 0:Fe.join(", "))||""),[le,ge]=useState((qe=t==null?void 0:t.involvesSensitiveData)!=null?qe:false),[E,be]=useState((t==null?void 0:t.likelyConsequences)||""),[M,fe]=useState((t==null?void 0:t.mitigationMeasures)||""),[$,he]=useState(((Pe=t==null?void 0:t.dpoContact)==null?void 0:Pe.name)||""),[O,ve]=useState(((ke=t==null?void 0:t.dpoContact)==null?void 0:ke.email)||""),[L,Ne]=useState(((Te=t==null?void 0:t.dpoContact)==null?void 0:Te.phone)||""),[z,_e]=useState((je=t==null?void 0:t.isPhasedReport)!=null?je:false),[Y,ye]=useState((t==null?void 0:t.supplementsReportId)||""),[ue,xe]=useState((t==null?void 0:t.status)||"ongoing"),[U,Ce]=useState((t==null?void 0:t.initialActions)||""),[_,H]=useState([]),[Ge,Z]=useState(false),[a$3,v]=useState({}),Ke=()=>{J(""),Q(""),X(""),V(""),ee(""),re(""),te(""),ie(""),ae(""),oe([]),se(""),de([]),me(""),ce(""),pe(""),ge(false),be(""),fe(""),he(""),ve(""),Ne(""),_e(false),ye(""),xe("ongoing"),Ce(""),H([]),Z(false),v({}),A==null||A();},We=r=>{let o=r.target.value;se(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);oe(l);},Je=r=>{de(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},Qe=r=>{var Ie;let o=r.target.files;if(!o)return;let l=[],s={};if(_.length+o.length>x){s.attachments=`Maximum of ${x} files allowed`,v(g=>a$1(a$1({},g),s));return}for(let g=0;g<o.length;g++){let y=o[g];if(y.size>C){s.attachments=`File ${y.name} exceeds the maximum size of ${C/(1024*1024)}MB`;continue}let Be="."+((Ie=y.name.split(".").pop())==null?void 0:Ie.toLowerCase());if(!S.includes(Be)){s.attachments=`File type ${Be} is not allowed`;continue}l.push(y);}l.length>0&&H(g=>[...g,...l]),Object.keys(s).length>0?v(g=>a$1(a$1({},g),s)):v(g=>b(a$1({},g),{attachments:""}));},Xe=r=>{H(o=>o.filter((l,s)=>s!==r));},Ve=()=>{let r={};return D.trim()||(r.breachTitle="Breach title is required"),R.trim()||(r.description="Description is required"),w||(r.category="Category is required"),F||(r.discoveredAt="Discovery date is required"),P.trim()||(r.reporterName="Reporter name is required"),N.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",k.trim()||(r.reporterDepartment="Reporter department is required"),ne.length===0&&(r.affectedSystems="At least one affected system is required"),j.length===0&&(r.dataTypes="At least one data type is required"),h&&isNaN(Number(h))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},er=r=>{r.preventDefault();let o=Ve();if(Object.keys(o).length>0){u==null||u(o);return}let l={title:a$2(D),description:a$2(R),category:w,discoveredAt:new Date(F).getTime(),occurredAt:q?new Date(q).getTime():void 0,reportedAt:Date.now(),reporter:{name:a$2(P),email:a$2(N),department:a$2(k),phone:T?a$2(T):void 0},affectedSystems:ne.map(s=>a$2(s)),dataTypes:j,estimatedAffectedSubjects:h?Number(h):void 0,approximateRecordCount:I?Number(I):void 0,dataSubjectCategories:B?B.split(",").map(s=>a$2(s.trim())).filter(Boolean):void 0,involvesSensitiveData:le,likelyConsequences:E?a$2(E):void 0,mitigationMeasures:M?a$2(M):void 0,dpoContact:$||O?{name:a$2($),email:a$2(O),phone:L?a$2(L):void 0}:void 0,isPhasedReport:z||void 0,supplementsReportId:Y?a$2(Y):void 0,status:ue,initialActions:U?a$2(U):void 0,attachments:_.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};$e(l),Ye&&Z(true);};if(Ge)return jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${G}`,children:[jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsx("p",{className:"ndpr-text-success",children:Ue}),jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-warning mb-2",children:"Important: Next Steps"}),jsx("p",{className:"ndpr-text-warning text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsx("button",{onClick:()=>Z(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${K}`,children:"Report Another Breach"})]});let rr=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${G}`,d.root,c),children:[jsx("h2",{className:a("ndpr-section-heading",d.title,c),children:Oe}),jsx("p",{className:"ndpr-card__subtitle",children:Le}),jsx("form",{onSubmit:er,className:a("",d.form,c),children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{className:a("",d.fieldGroup,c),children:[jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"breachTitle",className:a("ndpr-form-field__label",d.label,c),children:["Breach Title/Summary ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"breachTitle",value:D,onChange:r=>J(r.target.value),className:a("ndpr-form-field__input",d.input,c),required:true,"aria-invalid":!!a$3.breachTitle,"aria-describedby":a$3.breachTitle?"breachTitle-error":void 0}),a$3.breachTitle&&jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a$3.breachTitle})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"category",className:a("ndpr-form-field__label",d.label,c),children:["Breach Category ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"category",value:w,onChange:r=>X(r.target.value),className:a("ndpr-form-field__input",d.select,c),required:true,"aria-invalid":!!a$3.category,"aria-describedby":a$3.category?"category-error":void 0,children:[jsx("option",{value:"",children:"Select a category"}),Me.map(r=>jsx("option",{value:r.id,children:r.name},r.id))]}),a$3.category&&jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a$3.category})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"description",className:a("ndpr-form-field__label",d.label,c),children:["Detailed Description ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"description",value:R,onChange:r=>Q(r.target.value),rows:4,className:a("ndpr-form-field__input",d.textarea,c),required:true,"aria-invalid":!!a$3.description,"aria-describedby":a$3.description?"description-error":void 0}),a$3.description&&jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a$3.description})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"datetime-local",id:"discoveredAt",value:F,onChange:r=>V(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.discoveredAt,"aria-describedby":a$3.discoveredAt?"discoveredAt-error":void 0}),a$3.discoveredAt&&jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a$3.discoveredAt})]}),jsxs("div",{children:[jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsx("input",{type:"datetime-local",id:"occurredAt",value:q,onChange:r=>ee(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"reporterName",value:P,onChange:r=>re(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.reporterName,"aria-describedby":a$3.reporterName?"reporterName-error":void 0}),a$3.reporterName&&jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a$3.reporterName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"email",id:"reporterEmail",value:N,onChange:r=>te(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.reporterEmail,"aria-describedby":a$3.reporterEmail?"reporterEmail-error":void 0}),a$3.reporterEmail&&jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a$3.reporterEmail})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"reporterDepartment",value:k,onChange:r=>ie(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.reporterDepartment,"aria-describedby":a$3.reporterDepartment?"reporterDepartment-error":void 0}),a$3.reporterDepartment&&jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a$3.reporterDepartment})]}),jsxs("div",{children:[jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsx("input",{type:"tel",id:"reporterPhone",value:T,onChange:r=>ae(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"affectedSystems",value:Ze,onChange:We,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a$3.affectedSystems,"aria-describedby":a$3.affectedSystems?"affectedSystems-error":void 0}),a$3.affectedSystems&&jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a$3.affectedSystems})]}),jsxs("div",{children:[jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:h,onChange:r=>me(r.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a$3.estimatedAffectedSubjects,"aria-describedby":a$3.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a$3.estimatedAffectedSubjects&&jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a$3.estimatedAffectedSubjects})]}),jsxs("fieldset",{className:"md:col-span-2","aria-invalid":!!a$3.dataTypes,"aria-describedby":a$3.dataTypes?"dataTypes-error":void 0,children:[jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsx("span",{className:"ndpr-form-field__required","aria-hidden":"true",children:"*"}),jsx("span",{className:"sr-only",children:"(required)"})]}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:rr.map(r=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:j.includes(r.id),onChange:()=>Je(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm ndpr-text-muted",children:r.label})]},r.id))}),a$3.dataTypes&&jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a$3.dataTypes})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"status",value:ue,onChange:r=>xe(r.target.value),className:a("ndpr-form-field__input",d.select,c),required:true,children:[jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"approximateRecordCount",className:"ndpr-form-field__label",children:"Approximate Number of Records Concerned"}),jsx("input",{type:"text",id:"approximateRecordCount",value:I,onChange:r=>ce(r.target.value),placeholder:"e.g. 5000",className:"ndpr-form-field__input"}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required for the NDPC report (NDPA Section 40(2))."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",children:"Categories of Data Subjects Affected"}),jsx("input",{type:"text",id:"dataSubjectCategories",value:B,onChange:r=>pe(r.target.value),placeholder:"e.g. customers, employees, minors",className:"ndpr-form-field__input"}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Comma-separated. Required for the NDPC report (NDPA Section 40(2))."})]}),jsxs("div",{className:"md:col-span-2 flex items-center",children:[jsx("input",{id:"involvesSensitiveData",type:"checkbox",checked:le,onChange:r=>ge(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"involvesSensitiveData",className:"ml-2 text-sm ndpr-text-muted",children:"Sensitive personal data (NDPA Section 30) is involved"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"likelyConsequences",className:"ndpr-form-field__label",children:"Likely Consequences for Data Subjects"}),jsx("textarea",{id:"likelyConsequences",value:E,onChange:r=>be(r.target.value),placeholder:"e.g. identity theft, financial loss, reputational damage, discrimination",rows:3,className:a("ndpr-form-field__input",d.textarea,c)}),jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required content for NDPC report and Section 40(3) communications to data subjects."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"mitigationMeasures",className:"ndpr-form-field__label",children:"Mitigation Measures"}),jsx("textarea",{id:"mitigationMeasures",value:M,onChange:r=>fe(r.target.value),placeholder:"Measures taken or proposed to mitigate possible adverse effects (NDPA Section 40(3))",rows:3,className:a("ndpr-form-field__input",d.textarea,c)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("h4",{className:"ndpr-section-heading text-sm mt-4",children:"Data Protection Officer (NDPC contact)"}),jsx("p",{className:"text-xs ndpr-text-muted mb-2",children:"Defaults to organisation-level DPO if left blank."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoName",className:"ndpr-form-field__label",children:"DPO Name"}),jsx("input",{type:"text",id:"dpoName",value:$,onChange:r=>he(r.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoEmail",className:"ndpr-form-field__label",children:"DPO Email"}),jsx("input",{type:"email",id:"dpoEmail",value:O,onChange:r=>ve(r.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dpoPhone",className:"ndpr-form-field__label",children:"DPO Phone"}),jsx("input",{type:"tel",id:"dpoPhone",value:L,onChange:r=>Ne(r.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{className:"md:col-span-2 flex items-center mt-2",children:[jsx("input",{id:"isPhasedReport",type:"checkbox",checked:z,onChange:r=>_e(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"isPhasedReport",className:"ml-2 text-sm ndpr-text-muted",children:"This is a phased / interim report (Section 40(2) \u2014 complete info not yet available)"})]}),z&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"supplementsReportId",className:"ndpr-form-field__label",children:"Supplements Report ID (if applicable)"}),jsx("input",{type:"text",id:"supplementsReportId",value:Y,onChange:r=>ye(r.target.value),placeholder:"Prior report ID this report supplements",className:"ndpr-form-field__input"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsx("textarea",{id:"initialActions",value:U,onChange:r=>Ce(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:a("ndpr-form-field__input",d.textarea,c)})]})]})]}),He&&jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxs("div",{className:"ndpr-form-field",children:[jsx("label",{className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",x," files, ",C/(1024*1024),"MB each. Allowed types: ",S.join(", ")]}),jsx("input",{type:"file",onChange:Qe,multiple:true,className:"ndpr-form-field__input",accept:S.join(",")}),a$3.attachments&&jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a$3.attachments})]}),_.length>0&&jsxs("div",{className:"ndpr-form-field",children:[jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsx("ul",{className:"ndpr-form-section",children:_.map((r,o)=>jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxs("div",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 ndpr-text-muted mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsx("span",{className:"text-sm ndpr-text-muted",children:r.name}),jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxs("button",{type:"button",onClick:()=>Xe(o),"aria-label":`Remove attachment ${r.name}`,className:"text-red-500 hover:ndpr-text-destructive p-2 min-w-[44px] min-h-[44px] flex items-center justify-center",children:[jsx("svg",{"aria-hidden":"true",focusable:"false",className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}),jsx("span",{className:"sr-only",children:"Remove"})]})]},o))})]})]}),jsxs("div",{className:a("ndpr-alert ndpr-alert--info",d.notice,c),children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsx("div",{className:d.loadingOverlay}),jsx("button",{type:"submit",disabled:f,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${K} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":ze}),jsx("button",{type:"button",onClick:Ke,disabled:f,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
2
- export{or as a};