@tantainnovative/ndpr-toolkit 3.12.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +139 -0
- package/README.md +1 -1
- package/dist/breach.d.mts +3 -2
- package/dist/breach.d.ts +3 -2
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-37VFK5SR.js +6 -0
- package/dist/chunk-3E4IH7CE.js +1 -0
- package/dist/chunk-3H6FYU3Z.mjs +93 -0
- package/dist/chunk-3I6FYA5C.js +103 -0
- package/dist/chunk-3SIYRGJF.js +93 -0
- package/dist/chunk-3XU6FL2I.js +1 -0
- package/dist/chunk-42JPSNVV.mjs +6 -0
- package/dist/chunk-42UJFTII.js +1 -0
- package/dist/chunk-5F2IAUWJ.js +1 -0
- package/dist/chunk-63WM5PHZ.js +1 -0
- package/dist/chunk-6A6VI7ZP.mjs +1 -0
- package/dist/chunk-7FXNGGMO.js +1 -0
- package/dist/chunk-B2EXRSYG.mjs +1 -0
- package/dist/chunk-BGV2AKT7.mjs +1 -0
- package/dist/chunk-BL5W472Q.js +1 -0
- package/dist/chunk-BPMVJOHH.mjs +1 -0
- package/dist/chunk-D2UWB5OI.js +2 -0
- package/dist/chunk-DK7P5JEG.mjs +2 -0
- package/dist/chunk-ELK6VFKC.mjs +2 -0
- package/dist/chunk-F5MGMNQF.js +2 -0
- package/dist/chunk-FRQFU44F.mjs +1 -0
- package/dist/chunk-GUERZD4O.mjs +1 -0
- package/dist/{chunk-WYH3OA5L.mjs → chunk-I2ZBMR7F.mjs} +1 -1
- package/dist/chunk-J7BIJ45O.mjs +103 -0
- package/dist/{chunk-US2VGJ7I.js → chunk-KH3EQJQE.js} +1 -1
- package/dist/{chunk-IPWX5I5P.mjs → chunk-L3FR4PQE.mjs} +1 -1
- package/dist/chunk-N72RNTGP.mjs +6 -0
- package/dist/chunk-NB6SKG76.mjs +1 -0
- package/dist/chunk-RBKFNCGO.mjs +1 -0
- package/dist/chunk-TTMGFC6C.js +1 -0
- package/dist/{chunk-TWJHEIQH.js → chunk-UZNWXJ2W.js} +1 -1
- package/dist/chunk-V5TZJJWU.mjs +1 -0
- package/dist/chunk-WCTFED27.js +1 -0
- package/dist/chunk-WMISQDSV.js +1 -0
- package/dist/{chunk-MTSZ7GL6.mjs → chunk-WVHMY2BV.mjs} +1 -1
- package/dist/chunk-XYGGUGTO.js +6 -0
- package/dist/chunk-YDKWD6MQ.js +1 -0
- package/dist/chunk-Z2M5VJX2.mjs +1 -0
- package/dist/{chunk-D3DVVJCT.js → chunk-ZD2W3YU2.js} +1 -1
- package/dist/chunk-ZQHGIOYP.mjs +1 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +62 -0
- package/dist/core.d.ts +62 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border-lite.js +1 -1
- package/dist/cross-border-lite.mjs +1 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.d.mts +12 -3
- package/dist/dsr.d.ts +12 -3
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +12 -3
- package/dist/headless.d.ts +12 -3
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +12 -3
- package/dist/hooks.d.ts +12 -3
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +77 -5
- package/dist/index.d.ts +77 -5
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis-lite.js +1 -1
- package/dist/lawful-basis-lite.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets-consent.d.mts +5 -1
- package/dist/presets-consent.d.ts +5 -1
- package/dist/presets-consent.js +1 -1
- package/dist/presets-consent.mjs +1 -1
- package/dist/presets-dsr.js +1 -1
- package/dist/presets-dsr.mjs +1 -1
- package/dist/presets-policy.d.mts +23 -0
- package/dist/presets-policy.d.ts +23 -0
- package/dist/presets-policy.js +1 -1
- package/dist/presets-policy.mjs +1 -1
- package/dist/presets.d.mts +221 -4
- package/dist/presets.d.ts +221 -4
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa-lite.js +1 -1
- package/dist/ropa-lite.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/server.d.mts +62 -0
- package/dist/server.d.ts +62 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-25TNTLHJ.mjs +0 -1
- package/dist/chunk-4GIMXUMI.js +0 -6
- package/dist/chunk-5AECGMEB.js +0 -1
- package/dist/chunk-5EKQX6GM.mjs +0 -1
- package/dist/chunk-67KA345Q.mjs +0 -1
- package/dist/chunk-6GM2PBTF.js +0 -2
- package/dist/chunk-6OWCUDTN.mjs +0 -1
- package/dist/chunk-73BMSK67.js +0 -1
- package/dist/chunk-CAFCRCTZ.mjs +0 -1
- package/dist/chunk-EKNWO4DK.js +0 -1
- package/dist/chunk-FMJ6ICLJ.js +0 -1
- package/dist/chunk-G7JKRYM5.mjs +0 -1
- package/dist/chunk-GEP52QFH.mjs +0 -1
- package/dist/chunk-IB3KSUPZ.mjs +0 -1
- package/dist/chunk-JWAN5J4Y.js +0 -1
- package/dist/chunk-JYZOKO2W.mjs +0 -103
- package/dist/chunk-NDKDKDDX.js +0 -1
- package/dist/chunk-NX5MOBRI.js +0 -1
- package/dist/chunk-OLEUIYE2.mjs +0 -1
- package/dist/chunk-Q4CSVWSS.mjs +0 -1
- package/dist/chunk-QMAVEHOR.js +0 -1
- package/dist/chunk-RBMLGRDN.mjs +0 -1
- package/dist/chunk-ROC64RLP.js +0 -1
- package/dist/chunk-RR3KXNET.mjs +0 -6
- package/dist/chunk-TDHH7GS2.mjs +0 -2
- package/dist/chunk-TN4TH3CT.mjs +0 -2
- package/dist/chunk-VUFTRKKC.js +0 -2
- package/dist/chunk-WKTKTLMF.js +0 -1
- package/dist/chunk-WXUXCRAJ.js +0 -1
- package/dist/chunk-XN2UYZXH.mjs +0 -93
- package/dist/chunk-YK22SYCT.js +0 -103
- package/dist/chunk-YSD2DFBR.js +0 -6
- package/dist/chunk-YWCBI7SI.js +0 -93
- package/dist/chunk-ZHX62QAL.mjs +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,d,a as a$1,c as c$1}from'./chunk-XP5PL6K7.mjs';import {a as a$2}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import {a,b as b$1}from'./chunk-ZJYULEER.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var $=[{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_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],de=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],$e=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}],He={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"},Ve={active:"Active",inactive:"Inactive",archived:"Archived"},Ge={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};function Je(){let o=Date.now();return {id:`proc_${o}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:o,updatedAt:o}}function oe(o){return o?new Date(o).toLocaleDateString():"N/A"}var Ye=({ropa:o,onAddRecord:D,onUpdateRecord:y,onArchiveRecord:S,title:B,description:I,className:le="",buttonClassName:F="",classNames:e,unstyled:n})=>{var N,ee;let H=c(),pe=(N=B!=null?B:H.ropa.title)!=null?N:"Record of Processing Activities (ROPA)",ue=(ee=I!=null?I:H.ropa.description)!=null?ee:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",[f,b$2]=useState("list"),[w,ce]=useState(""),[P,se]=useState("all"),[k,ge]=useState("all"),[l,h]=useState(null),[V,C]=useState([]),[L,G]=useState(""),[E,J]=useState(""),[M,z]=useState(""),[O,W]=useState(""),[T,K]=useState(""),[j,Q]=useState(""),[q,X]=useState(""),g=useMemo(()=>b(o),[o]),_=useMemo(()=>d(o),[o]),Y=useMemo(()=>{let r=[...o.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),w){let a=w.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[o.records,P,k,w]);useEffect(()=>{l&&(G(l.purposes.join(", ")),J(l.dataCategories.join(", ")),z((l.sensitiveDataCategories||[]).join(", ")),W(l.dataSubjectCategories.join(", ")),K(l.recipients.join(", ")),Q(l.securityMeasures.join(", ")),X((l.systemsUsed||[]).join(", ")));},[l==null?void 0:l.id]);let me=useCallback(()=>{let r=Je();r.controllerDetails.name=o.organizationName,r.controllerDetails.contact=o.organizationContact,r.controllerDetails.address=o.organizationAddress,o.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=o.ndpcRegistrationNumber),o.dpoDetails&&(r.controllerDetails.dpoContact=o.dpoDetails.email),h(r),C([]),b$2("form");},[o.organizationName,o.organizationContact,o.organizationAddress,o.ndpcRegistrationNumber,o.dpoDetails]),ve=useCallback(r=>{h(a({},r)),C([]),b$2("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),fe=useCallback(()=>{if(!l)return;let r=b$1(a({},l),{purposes:v(L),dataCategories:v(E),sensitiveDataCategories:v(M),dataSubjectCategories:v(O),recipients:v(T),securityMeasures:v(j),systemsUsed:v(q),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a$2=a$1(r);if(!a$2.valid){C(a$2.errors);return}o.records.find(m=>m.id===r.id)?y==null||y(r.id,r):D==null||D(r),h(null),C([]),b$2("list");},[l,L,E,M,O,T,j,q,o.records,y,D]),be=useCallback(r=>{S==null||S(r);},[S]),he=useCallback(()=>{let r=c$1(o),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${o.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[o]),Z=useCallback(()=>{h(null),C([]),b$2("list");},[]),c$2=useCallback((r,a$1)=>{h(p=>p&&b$1(a({},p),{[r]:a$1}));},[]),U=useCallback((r,a$1)=>{h(p=>p&&b$1(a({},p),{controllerDetails:b$1(a({},p.controllerDetails),{[r]:a$1})}));},[]),_e=useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),xe=useCallback(r=>{ce(r.target.value);},[]),Ce=useCallback(r=>{se(r.target.value);},[]),Re=useCallback(r=>{ge(r.target.value);},[]),De=useCallback(r=>{G(r.target.value);},[]),ye=useCallback(r=>{J(r.target.value);},[]),Se=useCallback(r=>{z(r.target.value);},[]),we=useCallback(r=>{W(r.target.value);},[]),Pe=useCallback(r=>{K(r.target.value);},[]),ke=useCallback(r=>{Q(r.target.value);},[]),Ae=useCallback(r=>{X(r.target.value);},[]),Be=useCallback(()=>b$2("list"),[]),Ie=useCallback(()=>b$2("summary"),[]),Fe=useCallback(r=>jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${He[r]}`,e==null?void 0:e.statusBadge,n),children:Ve[r]}),[e==null?void 0:e.statusBadge,n]),Le=useCallback(r=>jsx("span",{className:"ndpr-badge ndpr-badge--info",children:Ge[r]}),[]),Ee=()=>jsxs("div",{className:a$2("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsx("p",{className:"ndpr-section-heading",children:o.organizationName})]}),o.dpoDetails&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsx("p",{className:"ndpr-section-heading",children:o.dpoDetails.name}),jsx("p",{className:"ndpr-form-field__hint",children:o.dpoDetails.email})]}),o.ndpcRegistrationNumber&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsx("p",{className:"ndpr-section-heading",children:o.ndpcRegistrationNumber})]})]}),jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",o.version," | Last Updated: ",oe(o.lastUpdated)]})]}),Me=()=>jsxs("div",{className:a$2("mb-6",e==null?void 0:e.summary,n),children:[jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxs("div",{className:a$2("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxs("div",{className:a$2("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxs("div",{className:a$2("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxs("div",{className:a$2("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),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"}),$.map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.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))]})]}),_.length>0&&jsxs("div",{className:a$2("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.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((a,p)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Oe=()=>jsxs("div",{children:[jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"ropaSearch",value:w,onChange:xe,placeholder:"Search records...",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxs("select",{id:"ropaStatusFilter",value:P,onChange:Ce,className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsx("option",{value:"all",children:"All Statuses"}),de.map(r=>jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxs("select",{id:"ropaBasisFilter",value:k,onChange:Re,className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsx("option",{value:"all",children:"All Bases"}),$.map(r=>jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxs("div",{className:"flex items-end space-x-2",children:[jsx("button",{onClick:me,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsx("button",{onClick:he,"aria-label":"Export ROPA records as CSV",className:a$2(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${F}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),Y.length===0?jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsx("thead",{className:a$2("ndpr-table__head",e==null?void 0:e.tableHeader,n),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:"Status"}),jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsx("tbody",{children:Y.map(r=>{let a=_e(r),p=_.some(m=>m.recordId===r.id);return jsxs("tr",{className:a$2(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),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}),a&&jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"ndpr-table__cell",children:Le(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",children:Fe(r.status)}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:oe(r.lastReviewedAt)}),jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{className:"ndpr-card__footer",children:[jsx("button",{onClick:()=>ve(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsx("button",{onClick:()=>be(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Te=useMemo(()=>l?!o.records.find(r=>r.id===l.id):true,[l,o.records]),je=()=>{if(!l)return null;let r=Te;return jsxs("div",{"data-ndpr-component":"ropa-manager",className:a$2("",e==null?void 0:e.form,n),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsx("button",{onClick:Z,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),V.length>0&&jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside",children:V.map((a,p)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxs("div",{className:"ndpr-form-section",children:[jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsx("input",{type:"text",id:"recordName",value:l.name,onChange:a=>c$2("name",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsx("input",{type:"text",id:"recordDepartment",value:l.department||"",onChange:a=>c$2("department",a.target.value||void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsx("textarea",{id:"recordDescription",value:l.description,onChange:a=>c$2("description",a.target.value),rows:3,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsx("select",{id:"recordStatus",value:l.status,onChange:a=>c$2("status",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:de.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsx("input",{type:"text",id:"controllerName",value:l.controllerDetails.name,onChange:a=>U("name",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsx("input",{type:"text",id:"controllerContact",value:l.controllerDetails.contact,onChange:a=>U("contact",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsx("input",{type:"text",id:"controllerAddress",value:l.controllerDetails.address,onChange:a=>U("address",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsx("select",{id:"lawfulBasis",value:l.lawfulBasis,onChange:a=>c$2("lawfulBasis",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:$.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsx("textarea",{id:"lawfulBasisJustification",value:l.lawfulBasisJustification,onChange:a=>c$2("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsx("input",{type:"text",id:"purposes",value:L,onChange:De,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsx("input",{type:"text",id:"dataCategories",value:E,onChange:ye,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsx("input",{type:"text",id:"sensitiveData",value:M,onChange:Se,className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsx("input",{type:"text",id:"subjectCategories",value:O,onChange:we,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsx("input",{type:"text",id:"recipients",value:T,onChange:Pe,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsx("select",{id:"dataSource",value:l.dataSource,onChange:a=>c$2("dataSource",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:$e.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),l.dataSource==="third_party"&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsx("input",{type:"text",id:"thirdPartyDetails",value:l.thirdPartySourceDetails||"",onChange:a=>c$2("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:l.retentionPeriod,onChange:a=>c$2("retentionPeriod",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:l.retentionJustification||"",onChange:a=>c$2("retentionJustification",a.target.value||void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsx("input",{type:"text",id:"securityMeasures",value:j,onChange:ke,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsx("input",{type:"text",id:"systemsUsed",value:q,onChange:Ae,className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"dpiaRequired",checked:l.dpiaRequired,onChange:a=>c$2("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),l.dpiaRequired&&jsxs("div",{children:[jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsx("input",{type:"text",id:"dpiaReference",value:l.dpiaReference||"",onChange:a=>c$2("dpiaReference",a.target.value||void 0),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:l.automatedDecisionMaking,onChange:a=>c$2("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),l.automatedDecisionMaking&&jsxs("div",{children:[jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsx("textarea",{id:"automatedDecisionMakingDetails",value:l.automatedDecisionMakingDetails||"",onChange:a=>c$2("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxs("div",{children:[jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsx("input",{type:"date",id:"nextReviewDate",value:l.nextReviewDate?new Date(l.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>c$2("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxs("div",{className:"flex justify-end space-x-3",children:[jsx("button",{onClick:Z,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsx("button",{onClick:fe,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},qe=()=>jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsx("button",{onClick:Be,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsx("button",{onClick:Ie,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${le}`,e==null?void 0:e.root,n),children:[jsx("h2",{className:a$2("ndpr-section-heading",e==null?void 0:e.title,n),children:pe}),jsx("p",{className:"ndpr-card__subtitle",children:ue}),Ee(),f!=="form"&&qe(),f==="list"&&Oe(),f==="summary"&&Me(),f==="form"&&je()]})};export{Ye as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js'),
|
|
1
|
+
'use strict';var chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var Vn=({options:d,onSave:bn,title:A,description:y,acceptAllButtonText:P,rejectAllButtonText:E,customizeButtonText:D,saveButtonText:z,position:pn="bottom",variant:a="bar",zIndex:x=9999,version:C="1.0",show:h,manageStorage:L=true,storageKey:w="ndpr_consent",className:V="",buttonClassName:j="",primaryButtonClassName:ln="",secondaryButtonClassName:fn="",classNames:n,unstyled:o,onAnalytics:k})=>{var U,X,Z,T,m,N,nn,tn,en;let c=chunkYDKWD6MQ_js.c(),gn=(U=A!=null?A:c.consent.title)!=null?U:"We Value Your Privacy",vn=(X=y!=null?y:c.consent.description)!=null?X:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",_n=(Z=P!=null?P:c.consent.acceptAll)!=null?Z:"Accept All",Cn=(T=E!=null?E:c.consent.rejectAll)!=null?T:"Reject All",hn=(m=D!=null?D:c.consent.customize)!=null?m:"Customize",an=(N=z!=null?z:c.consent.savePreferences)!=null?N:"Save Preferences",kn=(nn=c.consent.selectAll)!=null?nn:"Select All",Sn=(tn=c.consent.deselectAll)!=null?tn:"Deselect All",[b,u]=react.useState(false),[f,I]=react.useState(false),[S,B]=react.useState({}),[s,Bn]=react.useState(false),Rn=chunkL2VO3MEJ_js.a({active:b}),$=react.useRef(null),q=react.useRef(false);react.useEffect(()=>{Bn(true);},[]);let p=react.useCallback((t,e)=>{k==null||k(chunkRFPLZDIO_js.a({action:t,timestamp:Date.now(),version:C},e!==void 0?{categories:e}:{}));},[k,C]);react.useEffect(()=>{let t={};if(d.forEach(e=>{t[e.id]=e.defaultValue||false;}),B(t),h===void 0)if(!L)u(true);else {let e=localStorage.getItem(w);if(e)try{JSON.parse(e).version!==C?u(!0):u(!1);}catch(G){u(true);}else u(true);}else u(h);},[d,w,C,L]),react.useEffect(()=>{h!==void 0&&u(h);},[h]);let An=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),p("accepted_all",t),H(t);},J=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),p("rejected_all",t),H(t);},yn=(t,e)=>{B(G=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},G),{[t]:e}));},Pn=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),B(t);},En=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),B(t);},W=d.length>0&&d.every(t=>S[t.id]),Dn=()=>{p("customized",S),H(S);},H=t=>{let e={consents:t,timestamp:Date.now(),version:C,method:f?"customize":"banner",hasInteracted:true};L&&localStorage.setItem(w,JSON.stringify(e)),bn(e),u(false),I(false);};if(react.useEffect(()=>{if(!b)return;let t=e=>{e.key==="Escape"&&(p("dismissed"),J());};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[b,p,d,f]),react.useEffect(()=>{b&&!q.current&&(q.current=true,p("shown")),b||(q.current=false);},[b,p]),react.useEffect(()=>{if(f&&$.current){let t=$.current;t.style.maxHeight="0px",t.style.opacity="0",t.offsetHeight,t.style.maxHeight=`${t.scrollHeight}px`,t.style.opacity="1";}},[f]),!b)return null;let g=a==="modal"?"center":pn,Y=g==="inline",O=g==="center",v=["ndpr-consent-banner"];a!=="bar"&&v.push(`ndpr-consent-banner--${a}`),g==="top"?v.push("ndpr-consent-banner--top"):g==="bottom"?v.push("ndpr-consent-banner--bottom"):g==="inline"&&v.push("ndpr-consent-banner--inline"),V&&v.push(V);let zn=v.join(" "),K=`ndpr-consent-banner__button ndpr-consent-banner__button--primary ${j} ${ln}`.trim(),Ln=`ndpr-consent-banner__button ndpr-consent-banner__button--secondary ${j} ${fn}`.trim(),wn=`ndpr-consent-banner__button ndpr-consent-banner__button--ghost ${j}`.trim(),jn=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.acceptButton)||K,Q=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.rejectButton)||Ln,In=(n==null?void 0:n.customizeButton)||wn,$n=(n==null?void 0:n.saveButton)||K,F=jsxRuntime.jsx("div",{ref:Rn,tabIndex:-1,"data-ndpr-component":"consent-banner","data-ndpr-variant":a,"data-ndpr-position":g,className:chunkAME4HJR4_js.a(zn,n==null?void 0:n.root,o),style:!Y&&!O?{zIndex:x}:void 0,role:"dialog","aria-modal":O||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__container",n==null?void 0:n.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkAME4HJR4_js.a("ndpr-consent-banner__title",n==null?void 0:n.title,o),children:gn}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkAME4HJR4_js.a("ndpr-consent-banner__description",n==null?void 0:n.description,o),children:vn}),f&&jsxRuntime.jsxs("div",{ref:$,className:chunkAME4HJR4_js.a("ndpr-consent-banner__customize-panel",n==null?void 0:n.customizePanel,o),children:[jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__select-all-row",children:jsxRuntime.jsx("button",{type:"button",onClick:W?En:Pn,className:chunkAME4HJR4_js.a("ndpr-consent-banner__select-all-button",n==null?void 0:n.selectAllButton,o),children:W?Sn:kn})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__options-list",n==null?void 0:n.optionsList,o),children:d.map(t=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option",n==null?void 0:n.optionItem,o),children:[jsxRuntime.jsx("input",{id:`consent-${t.id}`,type:"checkbox",checked:S[t.id]||false,onChange:e=>yn(t.id,e.target.checked),disabled:t.required,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-checkbox",n==null?void 0:n.optionCheckbox,o)}),jsxRuntime.jsxs("div",{className:o?"":"ndpr-consent-banner__option-text",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${t.id}`,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-label",n==null?void 0:n.optionLabel,o),children:[t.label,t.required&&jsxRuntime.jsx("span",{className:o?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-description",n==null?void 0:n.optionDescription,o),children:t.description})]})]},t.id))}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:Dn,className:chunkAME4HJR4_js.a($n,n==null?void 0:n.saveButton,o),children:an}),jsxRuntime.jsx("button",{onClick:()=>I(false),className:chunkAME4HJR4_js.a(Q,n==null?void 0:n.rejectButton,o),children:(en=c.common.back)!=null?en:"Back"})]})]}),!f&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:An,className:chunkAME4HJR4_js.a(jn,n==null?void 0:n.acceptButton,o),children:_n}),jsxRuntime.jsx("button",{onClick:J,className:chunkAME4HJR4_js.a(Q,n==null?void 0:n.rejectButton,o),children:Cn}),jsxRuntime.jsx("button",{onClick:()=>I(true),className:chunkAME4HJR4_js.a(In,n==null?void 0:n.customizeButton,o),children:hn})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__footer-text",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(Y)return F;if(O){let t=jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__overlay",style:{zIndex:x},children:F});return s?reactDom.createPortal(t,document.body):null}return s?reactDom.createPortal(F,document.body):null};exports.a=Vn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import {jsxs,jsx}from'react/jsx-runtime';var K=({sections:v,answers:k,onAnswerChange:c$1,currentSectionIndex:o,onNextSection:S,onPrevSection:L,validationErrors:R={},readOnly:t=false,className:V="",buttonClassName:$="",nextButtonText:m,prevButtonText:b,submitButtonText:g,showProgress:j=true,progress:u,classNames:y={},unstyled:B=false})=>{var P,x,A;let _=c(),F=(P=m!=null?m:_.dpia.next)!=null?P:"Next",z=(x=b!=null?b:_.dpia.previous)!=null?x:"Previous",E=(A=g!=null?g:_.dpia.submit)!=null?A:"Submit",f=v[o],G=o===v.length-1,l=(e,r)=>{let d=r?y[r]:void 0;return !d&&r==="nextButton"&&(d=y.primaryButton),!d&&r==="prevButton"&&(d=y.secondaryButton),a(e,d,B)},W=e=>e.showWhen?e.showWhen.every(r=>{let d=k[r.questionId];switch(r.operator){case "equals":return d===r.value;case "contains":return Array.isArray(d)?d.includes(String(r.value)):false;case "greaterThan":return typeof d=="number"&&typeof r.value=="number"?d>r.value:false;case "lessThan":return typeof d=="number"&&typeof r.value=="number"?d<r.value:false;default:return true}}):true,h=e=>l("ndpr-form-field__input","input"),M=e=>{if(!W(e))return null;let r=R[e.id],d=k[e.id],s=typeof d=="boolean"?String(d):d,C=e.guidance?`${e.id}-guidance`:void 0,w=r?`${e.id}-error`:void 0,p=[C,w].filter(Boolean).join(" ")||void 0;return jsxs("div",{className:l("ndpr-form-field","question"),children:[jsxs("label",{htmlFor:e.id,className:l("ndpr-form-field__label","questionText"),children:[e.text,e.required&&jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),e.guidance&&jsx("p",{id:C,className:l("ndpr-form-field__hint","guidance"),children:e.guidance}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:s||"",onChange:a=>c$1(e.id,a.target.value),disabled:t,className:h(),"aria-required":e.required||void 0,"aria-describedby":p,"aria-invalid":r?true:void 0}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:s||"",onChange:a=>c$1(e.id,a.target.value),disabled:t,rows:4,className:h(),"aria-required":e.required||void 0,"aria-describedby":p,"aria-invalid":r?true:void 0}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:s||"",onChange:a=>c$1(e.id,a.target.value),disabled:t,className:h(),"aria-required":e.required||void 0,"aria-describedby":p,"aria-invalid":r?true:void 0,children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(a=>jsx("option",{value:a.value,children:a.label},a.value))]}),e.type==="radio"&&e.options&&jsx("div",{className:l("ndpr-form-field__option-group","radioGroup"),role:"radiogroup","aria-required":e.required||void 0,"aria-describedby":p,"aria-invalid":r?true:void 0,children:e.options.map(a=>jsxs("div",{className:l("ndpr-form-field__checkbox-row","radioOption"),children:[jsx("input",{type:"radio",id:`${e.id}_${a.value}`,name:e.id,value:a.value,checked:s===a.value,onChange:()=>c$1(e.id,a.value),disabled:t,className:"ndpr-form-field__radio"}),jsxs("label",{htmlFor:`${e.id}_${a.value}`,className:"ndpr-form-field__label",children:[a.label,a.riskLevel&&jsxs("span",{className:a.riskLevel==="low"?"ndpr-badge ndpr-badge--success":a.riskLevel==="medium"?"ndpr-badge ndpr-badge--warning":"ndpr-badge ndpr-badge--destructive",children:[a.riskLevel.charAt(0).toUpperCase()+a.riskLevel.slice(1)," Risk"]})]})]},a.value))}),e.type==="checkbox"&&e.options&&jsx("div",{className:"ndpr-form-field__option-group",role:"group","aria-label":e.text,"aria-describedby":p,"aria-invalid":r?true:void 0,children:e.options.map(a=>jsxs("div",{className:"ndpr-form-field__checkbox-row",children:[jsx("input",{type:"checkbox",id:`${e.id}_${a.value}`,value:a.value,checked:Array.isArray(s)?s.includes(a.value):false,onChange:N=>{let D=Array.isArray(s)?[...s]:[];N.target.checked?c$1(e.id,[...D,a.value]):c$1(e.id,D.filter(U=>U!==a.value));},disabled:t,className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:`${e.id}_${a.value}`,className:"ndpr-form-field__label",children:a.label})]},a.value))}),e.type==="scale"&&jsxs("div",{className:"ndpr-form-field",children:[jsx("div",{className:"ndpr-form-field__hint",style:{display:"flex",justifyContent:"space-between"},children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([a,N])=>jsx("span",{style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`,textAlign:"center"},children:N},a))}),jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:typeof s=="number"?s:e.minValue||1,onChange:a=>c$1(e.id,parseInt(a.target.value,10)),disabled:t,className:"ndpr-form-field__range","aria-required":e.required||void 0,"aria-describedby":p,"aria-invalid":r?true:void 0}),jsxs("div",{className:"ndpr-form-field__hint",style:{textAlign:"center"},children:["Selected value: ",s||e.minValue||1]})]}),r&&jsx("p",{id:w,className:"ndpr-form-field__error",role:"alert",children:r})]},e.id)};return f?jsxs("div",{"data-ndpr-component":"dpia-questionnaire",className:`${l("ndpr-card","root")} ${V}`,children:[j&&jsxs("div",{className:l("ndpr-card__header","header"),style:{flexDirection:"column",alignItems:"stretch",gap:"var(--ndpr-space-2)"},children:[jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"var(--ndpr-font-size-sm)",color:"rgb(var(--ndpr-muted-foreground))"},children:[jsxs("span",{children:["Section ",o+1," of ",v.length]}),jsx("span",{children:u!==void 0?`${u}% Complete`:""})]}),jsx("div",{className:l("ndpr-progress","progressBar"),role:"progressbar","aria-valuenow":u!==void 0?u:Math.round((o+1)/v.length*100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Questionnaire progress",children:jsx("div",{className:"ndpr-progress__bar",style:{width:`${u!==void 0?u:(o+1)/v.length*100}%`}})})]}),jsx("h2",{className:l("ndpr-card__title","title"),"aria-live":"polite",children:f.title}),f.description&&jsx("p",{className:l("ndpr-card__subtitle","sectionTitle"),children:f.description}),jsx("div",{className:l("ndpr-card__body","section"),children:f.questions.map(e=>M(e))}),jsxs("div",{className:l("ndpr-card__footer","navigation"),style:{justifyContent:"space-between"},children:[jsx("button",{type:"button",onClick:L,disabled:o===0||t,className:`${l("ndpr-button ndpr-button--secondary","prevButton")} ${$}`,children:z}),jsx("button",{type:"button",onClick:S,disabled:t,className:`${l("ndpr-button ndpr-button--primary","nextButton")} ${$}`,children:G?E:F})]})]}):jsx("div",{children:"No section found."})};export{K as a};
|
package/dist/consent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunkSJDDNB6M_js=require('./chunk-SJDDNB6M.js'),
|
|
2
|
+
'use strict';var chunkSJDDNB6M_js=require('./chunk-SJDDNB6M.js'),chunk42UJFTII_js=require('./chunk-42UJFTII.js'),chunkZD2W3YU2_js=require('./chunk-ZD2W3YU2.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),chunkHOAC5VUF_js=require('./chunk-HOAC5VUF.js');require('./chunk-L2VO3MEJ.js'),require('./chunk-C2KEXHRX.js');var chunkB46SJB5V_js=require('./chunk-B46SJB5V.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js');require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-VWED6UTN.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var v=react.createContext(null);function p(){let t=react.useContext(v);if(!t)throw new Error("Consent compound components must be wrapped in <Consent.Provider>. Example: <Consent.Provider options={...}><Consent.Banner /></Consent.Provider>");return t}var g=({options:t,adapter:n,version:s,onChange:r,children:c})=>{let C=chunkHOAC5VUF_js.a({options:t,adapter:n,version:s,onChange:r}),o=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},C),{options:t});return jsxRuntime.jsx(v.Provider,{value:o,children:c})};var P=({classNames:t,unstyled:n})=>{let{options:s,settings:r}=p(),[c,C]=react.useState(()=>{let o={};return s.forEach(i=>{var a,_;o[i.id]=(_=(a=r==null?void 0:r.consents[i.id])!=null?a:i.defaultValue)!=null?_:false;}),o});return jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__options-list",t==null?void 0:t.root,n),"data-ndpr-component":"consent-option-list",children:s.map(o=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option",t==null?void 0:t.optionItem,n),children:[jsxRuntime.jsx("input",{id:`consent-${o.id}`,type:"checkbox",checked:c[o.id]||false,onChange:i=>C(a=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},a),{[o.id]:i.target.checked})),disabled:o.required,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-checkbox",t==null?void 0:t.optionCheckbox,n),"aria-label":o.label}),jsxRuntime.jsxs("div",{className:n?"":"ndpr-consent-banner__option-text",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${o.id}`,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-label",t==null?void 0:t.optionLabel,n),children:[o.label,o.required&&jsxRuntime.jsx("span",{className:n?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-description",t==null?void 0:t.optionDescription,n),children:o.description})]})]},o.id))})};var R=({children:t,className:n,unstyled:s})=>{let{acceptAll:r}=p();return jsxRuntime.jsx("button",{onClick:r,className:chunkAME4HJR4_js.a("ndpr-consent-banner__button ndpr-consent-banner__button--primary",n,s),"data-ndpr-component":"consent-accept-button",children:t!=null?t:"Accept All"})};var S=({children:t,className:n,unstyled:s})=>{let{rejectAll:r}=p();return jsxRuntime.jsx("button",{onClick:r,className:chunkAME4HJR4_js.a("ndpr-consent-banner__button ndpr-consent-banner__button--secondary",n,s),"data-ndpr-component":"consent-reject-button",children:t!=null?t:"Reject All"})};var y=({children:t,className:n,unstyled:s,consents:r})=>{let{updateConsent:c,options:C}=p();return jsxRuntime.jsx("button",{onClick:()=>{if(r)c(r);else {let i={};C.forEach(a=>{i[a.id]=a.required||false;}),c(i);}},className:chunkAME4HJR4_js.a("ndpr-consent-banner__button ndpr-consent-banner__button--primary",n,s),"data-ndpr-component":"consent-save-button",children:t!=null?t:"Save Preferences"})};var I={Provider:g,OptionList:P,AcceptButton:R,RejectButton:S,SaveButton:y,Banner:chunkZD2W3YU2_js.a,Settings:chunk42UJFTII_js.a,Storage:chunkSJDDNB6M_js.a};Object.defineProperty(exports,"ConsentStorage",{enumerable:true,get:function(){return chunkSJDDNB6M_js.a}});Object.defineProperty(exports,"ConsentManager",{enumerable:true,get:function(){return chunk42UJFTII_js.a}});Object.defineProperty(exports,"ConsentBanner",{enumerable:true,get:function(){return chunkZD2W3YU2_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk3IA3KDII_js.b}});Object.defineProperty(exports,"useConsent",{enumerable:true,get:function(){return chunkHOAC5VUF_js.a}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkB46SJB5V_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkB46SJB5V_js.b}});Object.defineProperty(exports,"resolveClass",{enumerable:true,get:function(){return chunkAME4HJR4_js.a}});exports.Consent=I;exports.ConsentAcceptButton=R;exports.ConsentOptionList=P;exports.ConsentProvider=g;exports.ConsentRejectButton=S;exports.ConsentSaveButton=y;exports.useConsentCompound=p;
|
package/dist/consent.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {a}from'./chunk-XOH4WXOZ.mjs';export{a as ConsentStorage}from'./chunk-XOH4WXOZ.mjs';import {a as a$1}from'./chunk-
|
|
2
|
+
import {a}from'./chunk-XOH4WXOZ.mjs';export{a as ConsentStorage}from'./chunk-XOH4WXOZ.mjs';import {a as a$1}from'./chunk-BPMVJOHH.mjs';export{a as ConsentManager}from'./chunk-BPMVJOHH.mjs';import {a as a$2}from'./chunk-I2ZBMR7F.mjs';export{a as ConsentBanner}from'./chunk-I2ZBMR7F.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';import {a as a$3}from'./chunk-IHNAFXDM.mjs';export{a as useConsent}from'./chunk-IHNAFXDM.mjs';import'./chunk-YTU4FNM2.mjs';import'./chunk-XC3DLYEG.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-PJNKQPQP.mjs';import {a as a$5}from'./chunk-SFGW37LE.mjs';export{a as resolveClass}from'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-DBZSN4WP.mjs';import {b,a as a$4}from'./chunk-ZJYULEER.mjs';import {createContext,useContext,useState}from'react';import {jsx,jsxs}from'react/jsx-runtime';var v=createContext(null);function p(){let t=useContext(v);if(!t)throw new Error("Consent compound components must be wrapped in <Consent.Provider>. Example: <Consent.Provider options={...}><Consent.Banner /></Consent.Provider>");return t}var g=({options:t,adapter:n,version:s,onChange:r,children:c})=>{let C=a$3({options:t,adapter:n,version:s,onChange:r}),o=b(a$4({},C),{options:t});return jsx(v.Provider,{value:o,children:c})};var P=({classNames:t,unstyled:n})=>{let{options:s,settings:r}=p(),[c,C]=useState(()=>{let o={};return s.forEach(i=>{var a,_;o[i.id]=(_=(a=r==null?void 0:r.consents[i.id])!=null?a:i.defaultValue)!=null?_:false;}),o});return jsx("div",{className:a$5("ndpr-consent-banner__options-list",t==null?void 0:t.root,n),"data-ndpr-component":"consent-option-list",children:s.map(o=>jsxs("div",{className:a$5("ndpr-consent-banner__option",t==null?void 0:t.optionItem,n),children:[jsx("input",{id:`consent-${o.id}`,type:"checkbox",checked:c[o.id]||false,onChange:i=>C(a=>b(a$4({},a),{[o.id]:i.target.checked})),disabled:o.required,className:a$5("ndpr-consent-banner__option-checkbox",t==null?void 0:t.optionCheckbox,n),"aria-label":o.label}),jsxs("div",{className:n?"":"ndpr-consent-banner__option-text",children:[jsxs("label",{htmlFor:`consent-${o.id}`,className:a$5("ndpr-consent-banner__option-label",t==null?void 0:t.optionLabel,n),children:[o.label,o.required&&jsx("span",{className:n?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsx("p",{className:a$5("ndpr-consent-banner__option-description",t==null?void 0:t.optionDescription,n),children:o.description})]})]},o.id))})};var R=({children:t,className:n,unstyled:s})=>{let{acceptAll:r}=p();return jsx("button",{onClick:r,className:a$5("ndpr-consent-banner__button ndpr-consent-banner__button--primary",n,s),"data-ndpr-component":"consent-accept-button",children:t!=null?t:"Accept All"})};var S=({children:t,className:n,unstyled:s})=>{let{rejectAll:r}=p();return jsx("button",{onClick:r,className:a$5("ndpr-consent-banner__button ndpr-consent-banner__button--secondary",n,s),"data-ndpr-component":"consent-reject-button",children:t!=null?t:"Reject All"})};var y=({children:t,className:n,unstyled:s,consents:r})=>{let{updateConsent:c,options:C}=p();return jsx("button",{onClick:()=>{if(r)c(r);else {let i={};C.forEach(a=>{i[a.id]=a.required||false;}),c(i);}},className:a$5("ndpr-consent-banner__button ndpr-consent-banner__button--primary",n,s),"data-ndpr-component":"consent-save-button",children:t!=null?t:"Save Preferences"})};var I={Provider:g,OptionList:P,AcceptButton:R,RejectButton:S,SaveButton:y,Banner:a$2,Settings:a$1,Storage:a};export{I as Consent,R as ConsentAcceptButton,P as ConsentOptionList,g as ConsentProvider,S as ConsentRejectButton,y as ConsentSaveButton,p as useConsentCompound};
|
package/dist/core.d.mts
CHANGED
|
@@ -1221,6 +1221,12 @@ export declare interface NDPRLocale {
|
|
|
1221
1221
|
deselectAll?: string;
|
|
1222
1222
|
required?: string;
|
|
1223
1223
|
cookieNotice?: string;
|
|
1224
|
+
/** ConsentManager component title */
|
|
1225
|
+
managerTitle?: string;
|
|
1226
|
+
/** ConsentManager component description */
|
|
1227
|
+
managerDescription?: string;
|
|
1228
|
+
/** ConsentManager reset button */
|
|
1229
|
+
resetToDefaults?: string;
|
|
1224
1230
|
};
|
|
1225
1231
|
dsr?: {
|
|
1226
1232
|
title?: string;
|
|
@@ -1237,6 +1243,14 @@ export declare interface NDPRLocale {
|
|
|
1237
1243
|
identifierValue?: string;
|
|
1238
1244
|
privacyNotice?: string;
|
|
1239
1245
|
successMessage?: string;
|
|
1246
|
+
/** DSRDashboard component title */
|
|
1247
|
+
dashboardTitle?: string;
|
|
1248
|
+
/** DSRDashboard component description */
|
|
1249
|
+
dashboardDescription?: string;
|
|
1250
|
+
/** DSRTracker component title */
|
|
1251
|
+
trackerTitle?: string;
|
|
1252
|
+
/** DSRTracker component description */
|
|
1253
|
+
trackerDescription?: string;
|
|
1240
1254
|
};
|
|
1241
1255
|
breach?: {
|
|
1242
1256
|
title?: string;
|
|
@@ -1246,6 +1260,18 @@ export declare interface NDPRLocale {
|
|
|
1246
1260
|
category?: string;
|
|
1247
1261
|
discoveredAt?: string;
|
|
1248
1262
|
detailedDescription?: string;
|
|
1263
|
+
/** BreachRiskAssessment component title */
|
|
1264
|
+
riskAssessmentTitle?: string;
|
|
1265
|
+
/** BreachRiskAssessment component description */
|
|
1266
|
+
riskAssessmentDescription?: string;
|
|
1267
|
+
/** BreachNotificationManager component title */
|
|
1268
|
+
notificationManagerTitle?: string;
|
|
1269
|
+
/** BreachNotificationManager component description */
|
|
1270
|
+
notificationManagerDescription?: string;
|
|
1271
|
+
/** RegulatoryReportGenerator component title */
|
|
1272
|
+
regulatoryReportTitle?: string;
|
|
1273
|
+
/** RegulatoryReportGenerator component description */
|
|
1274
|
+
regulatoryReportDescription?: string;
|
|
1249
1275
|
};
|
|
1250
1276
|
dpia?: {
|
|
1251
1277
|
title?: string;
|
|
@@ -1253,6 +1279,10 @@ export declare interface NDPRLocale {
|
|
|
1253
1279
|
previous?: string;
|
|
1254
1280
|
complete?: string;
|
|
1255
1281
|
progress?: string;
|
|
1282
|
+
/** DPIAQuestionnaire submit button (last section) */
|
|
1283
|
+
submit?: string;
|
|
1284
|
+
/** DPIAReport main report title */
|
|
1285
|
+
reportTitle?: string;
|
|
1256
1286
|
};
|
|
1257
1287
|
policy?: {
|
|
1258
1288
|
title?: string;
|
|
@@ -1261,6 +1291,38 @@ export declare interface NDPRLocale {
|
|
|
1261
1291
|
export?: string;
|
|
1262
1292
|
sections?: string;
|
|
1263
1293
|
variables?: string;
|
|
1294
|
+
/** PolicyGenerator component title */
|
|
1295
|
+
generatorTitle?: string;
|
|
1296
|
+
/** PolicyGenerator component description */
|
|
1297
|
+
generatorDescription?: string;
|
|
1298
|
+
/** PolicyPreview component title */
|
|
1299
|
+
previewTitle?: string;
|
|
1300
|
+
/** PolicyPreview component description */
|
|
1301
|
+
previewDescription?: string;
|
|
1302
|
+
/** PolicyExporter component title */
|
|
1303
|
+
exporterTitle?: string;
|
|
1304
|
+
/** PolicyExporter component description */
|
|
1305
|
+
exporterDescription?: string;
|
|
1306
|
+
/** AdaptivePolicyWizard heading */
|
|
1307
|
+
wizardTitle?: string;
|
|
1308
|
+
};
|
|
1309
|
+
lawfulBasis?: {
|
|
1310
|
+
/** LawfulBasisTracker title */
|
|
1311
|
+
title?: string;
|
|
1312
|
+
/** LawfulBasisTracker description */
|
|
1313
|
+
description?: string;
|
|
1314
|
+
};
|
|
1315
|
+
crossBorder?: {
|
|
1316
|
+
/** CrossBorderTransferManager title */
|
|
1317
|
+
title?: string;
|
|
1318
|
+
/** CrossBorderTransferManager description */
|
|
1319
|
+
description?: string;
|
|
1320
|
+
};
|
|
1321
|
+
ropa?: {
|
|
1322
|
+
/** ROPAManager title */
|
|
1323
|
+
title?: string;
|
|
1324
|
+
/** ROPAManager description */
|
|
1325
|
+
description?: string;
|
|
1264
1326
|
};
|
|
1265
1327
|
compliance?: {
|
|
1266
1328
|
score?: string;
|
package/dist/core.d.ts
CHANGED
|
@@ -1221,6 +1221,12 @@ export declare interface NDPRLocale {
|
|
|
1221
1221
|
deselectAll?: string;
|
|
1222
1222
|
required?: string;
|
|
1223
1223
|
cookieNotice?: string;
|
|
1224
|
+
/** ConsentManager component title */
|
|
1225
|
+
managerTitle?: string;
|
|
1226
|
+
/** ConsentManager component description */
|
|
1227
|
+
managerDescription?: string;
|
|
1228
|
+
/** ConsentManager reset button */
|
|
1229
|
+
resetToDefaults?: string;
|
|
1224
1230
|
};
|
|
1225
1231
|
dsr?: {
|
|
1226
1232
|
title?: string;
|
|
@@ -1237,6 +1243,14 @@ export declare interface NDPRLocale {
|
|
|
1237
1243
|
identifierValue?: string;
|
|
1238
1244
|
privacyNotice?: string;
|
|
1239
1245
|
successMessage?: string;
|
|
1246
|
+
/** DSRDashboard component title */
|
|
1247
|
+
dashboardTitle?: string;
|
|
1248
|
+
/** DSRDashboard component description */
|
|
1249
|
+
dashboardDescription?: string;
|
|
1250
|
+
/** DSRTracker component title */
|
|
1251
|
+
trackerTitle?: string;
|
|
1252
|
+
/** DSRTracker component description */
|
|
1253
|
+
trackerDescription?: string;
|
|
1240
1254
|
};
|
|
1241
1255
|
breach?: {
|
|
1242
1256
|
title?: string;
|
|
@@ -1246,6 +1260,18 @@ export declare interface NDPRLocale {
|
|
|
1246
1260
|
category?: string;
|
|
1247
1261
|
discoveredAt?: string;
|
|
1248
1262
|
detailedDescription?: string;
|
|
1263
|
+
/** BreachRiskAssessment component title */
|
|
1264
|
+
riskAssessmentTitle?: string;
|
|
1265
|
+
/** BreachRiskAssessment component description */
|
|
1266
|
+
riskAssessmentDescription?: string;
|
|
1267
|
+
/** BreachNotificationManager component title */
|
|
1268
|
+
notificationManagerTitle?: string;
|
|
1269
|
+
/** BreachNotificationManager component description */
|
|
1270
|
+
notificationManagerDescription?: string;
|
|
1271
|
+
/** RegulatoryReportGenerator component title */
|
|
1272
|
+
regulatoryReportTitle?: string;
|
|
1273
|
+
/** RegulatoryReportGenerator component description */
|
|
1274
|
+
regulatoryReportDescription?: string;
|
|
1249
1275
|
};
|
|
1250
1276
|
dpia?: {
|
|
1251
1277
|
title?: string;
|
|
@@ -1253,6 +1279,10 @@ export declare interface NDPRLocale {
|
|
|
1253
1279
|
previous?: string;
|
|
1254
1280
|
complete?: string;
|
|
1255
1281
|
progress?: string;
|
|
1282
|
+
/** DPIAQuestionnaire submit button (last section) */
|
|
1283
|
+
submit?: string;
|
|
1284
|
+
/** DPIAReport main report title */
|
|
1285
|
+
reportTitle?: string;
|
|
1256
1286
|
};
|
|
1257
1287
|
policy?: {
|
|
1258
1288
|
title?: string;
|
|
@@ -1261,6 +1291,38 @@ export declare interface NDPRLocale {
|
|
|
1261
1291
|
export?: string;
|
|
1262
1292
|
sections?: string;
|
|
1263
1293
|
variables?: string;
|
|
1294
|
+
/** PolicyGenerator component title */
|
|
1295
|
+
generatorTitle?: string;
|
|
1296
|
+
/** PolicyGenerator component description */
|
|
1297
|
+
generatorDescription?: string;
|
|
1298
|
+
/** PolicyPreview component title */
|
|
1299
|
+
previewTitle?: string;
|
|
1300
|
+
/** PolicyPreview component description */
|
|
1301
|
+
previewDescription?: string;
|
|
1302
|
+
/** PolicyExporter component title */
|
|
1303
|
+
exporterTitle?: string;
|
|
1304
|
+
/** PolicyExporter component description */
|
|
1305
|
+
exporterDescription?: string;
|
|
1306
|
+
/** AdaptivePolicyWizard heading */
|
|
1307
|
+
wizardTitle?: string;
|
|
1308
|
+
};
|
|
1309
|
+
lawfulBasis?: {
|
|
1310
|
+
/** LawfulBasisTracker title */
|
|
1311
|
+
title?: string;
|
|
1312
|
+
/** LawfulBasisTracker description */
|
|
1313
|
+
description?: string;
|
|
1314
|
+
};
|
|
1315
|
+
crossBorder?: {
|
|
1316
|
+
/** CrossBorderTransferManager title */
|
|
1317
|
+
title?: string;
|
|
1318
|
+
/** CrossBorderTransferManager description */
|
|
1319
|
+
description?: string;
|
|
1320
|
+
};
|
|
1321
|
+
ropa?: {
|
|
1322
|
+
/** ROPAManager title */
|
|
1323
|
+
title?: string;
|
|
1324
|
+
/** ROPAManager description */
|
|
1325
|
+
description?: string;
|
|
1264
1326
|
};
|
|
1265
1327
|
compliance?: {
|
|
1266
1328
|
score?: string;
|
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk3XU6FL2I_js=require('./chunk-3XU6FL2I.js'),chunkNUOHT3LO_js=require('./chunk-NUOHT3LO.js'),chunkRDALAH3Y_js=require('./chunk-RDALAH3Y.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkD2ZKDQVL_js=require('./chunk-D2ZKDQVL.js'),chunk6LJHLE6G_js=require('./chunk-6LJHLE6G.js'),chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js'),chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),chunkB46SJB5V_js=require('./chunk-B46SJB5V.js'),chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkOZHUINWS_js=require('./chunk-OZHUINWS.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js'),chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js'),chunkTTMGFC6C_js=require('./chunk-TTMGFC6C.js');require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"hausaLocale",{enumerable:true,get:function(){return chunk3XU6FL2I_js.c}});Object.defineProperty(exports,"igboLocale",{enumerable:true,get:function(){return chunk3XU6FL2I_js.b}});Object.defineProperty(exports,"pidginLocale",{enumerable:true,get:function(){return chunk3XU6FL2I_js.d}});Object.defineProperty(exports,"yorubaLocale",{enumerable:true,get:function(){return chunk3XU6FL2I_js.a}});Object.defineProperty(exports,"ORG_POLICY_TEMPLATE_REGISTRY",{enumerable:true,get:function(){return chunkNUOHT3LO_js.a}});Object.defineProperty(exports,"createOrgTemplate",{enumerable:true,get:function(){return chunkNUOHT3LO_js.b}});Object.defineProperty(exports,"templateContextFor",{enumerable:true,get:function(){return chunkNUOHT3LO_js.b}});Object.defineProperty(exports,"getComplianceScore",{enumerable:true,get:function(){return chunkRDALAH3Y_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunk3YTAOT5O_js.a}});Object.defineProperty(exports,"DEFAULT_POLICY_SECTIONS",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.c}});Object.defineProperty(exports,"DEFAULT_POLICY_VARIABLES",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.d}});Object.defineProperty(exports,"createBusinessPolicyTemplate",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.e}});Object.defineProperty(exports,"findUnfilledTokens",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.a}});Object.defineProperty(exports,"generatePolicyText",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.b}});Object.defineProperty(exports,"assemblePolicy",{enumerable:true,get:function(){return chunk6LJHLE6G_js.c}});Object.defineProperty(exports,"createDefaultContext",{enumerable:true,get:function(){return chunk6LJHLE6G_js.e}});Object.defineProperty(exports,"evaluatePolicyCompliance",{enumerable:true,get:function(){return chunk6LJHLE6G_js.f}});Object.defineProperty(exports,"assessTransferRisk",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.h}});Object.defineProperty(exports,"getTransferMechanismDescription",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.f}});Object.defineProperty(exports,"isNDPCApprovalRequired",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.e}});Object.defineProperty(exports,"validateTransfer",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.g}});Object.defineProperty(exports,"assessComplianceGaps",{enumerable:true,get:function(){return chunkWZYCBW2R_js.c}});Object.defineProperty(exports,"generateLawfulBasisSummary",{enumerable:true,get:function(){return chunkWZYCBW2R_js.d}});Object.defineProperty(exports,"getLawfulBasisDescription",{enumerable:true,get:function(){return chunkWZYCBW2R_js.b}});Object.defineProperty(exports,"validateProcessingActivity",{enumerable:true,get:function(){return chunkWZYCBW2R_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}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk3IA3KDII_js.b}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkB46SJB5V_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkB46SJB5V_js.b}});Object.defineProperty(exports,"sanitizeInput",{enumerable:true,get:function(){return chunkUXUMYP4L_js.a}});Object.defineProperty(exports,"formatDSRRequest",{enumerable:true,get:function(){return chunkOZHUINWS_js.b}});Object.defineProperty(exports,"validateDsrSubmission",{enumerable:true,get:function(){return chunkOZHUINWS_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkTQZWJGJ2_js.a}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_LONG",{enumerable:true,get:function(){return chunkZVOIR4QH_js.b}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_SHORT",{enumerable:true,get:function(){return chunkZVOIR4QH_js.a}});Object.defineProperty(exports,"legalDisclaimerBlock",{enumerable:true,get:function(){return chunkZVOIR4QH_js.c}});Object.defineProperty(exports,"NDPRProvider",{enumerable:true,get:function(){return chunkYDKWD6MQ_js.a}});Object.defineProperty(exports,"useNDPRConfig",{enumerable:true,get:function(){return chunkYDKWD6MQ_js.b}});Object.defineProperty(exports,"useNDPRLocale",{enumerable:true,get:function(){return chunkYDKWD6MQ_js.c}});Object.defineProperty(exports,"defaultLocale",{enumerable:true,get:function(){return chunkTTMGFC6C_js.a}});Object.defineProperty(exports,"mergeLocale",{enumerable:true,get:function(){return chunkTTMGFC6C_js.b}});
|
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-
|
|
1
|
+
export{c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-BGV2AKT7.mjs';export{a as ORG_POLICY_TEMPLATE_REGISTRY,b as createOrgTemplate,b as templateContextFor}from'./chunk-CWY2FMIC.mjs';export{a as getComplianceScore}from'./chunk-7RBO42IW.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';export{c as DEFAULT_POLICY_SECTIONS,d as DEFAULT_POLICY_VARIABLES,e as createBusinessPolicyTemplate,a as findUnfilledTokens,b as generatePolicyText}from'./chunk-NBQQ2GN3.mjs';export{c as assemblePolicy,e as createDefaultContext,f as evaluatePolicyCompliance}from'./chunk-BIJSMSUU.mjs';export{h as assessTransferRisk,f as getTransferMechanismDescription,e as isNDPCApprovalRequired,g as validateTransfer}from'./chunk-7BJXI2HI.mjs';export{c as assessComplianceGaps,d as generateLawfulBasisSummary,b as getLawfulBasisDescription,a as validateProcessingActivity}from'./chunk-LWIKDDSU.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-PJNKQPQP.mjs';export{a as sanitizeInput}from'./chunk-EWVK45Z3.mjs';export{b as formatDSRRequest,a as validateDsrSubmission}from'./chunk-VPNK7OID.mjs';export{a as assessDPIARisk}from'./chunk-LRRENTT5.mjs';export{b as LEGAL_DISCLAIMER_LONG,a as LEGAL_DISCLAIMER_SHORT,c as legalDisclaimerBlock}from'./chunk-ITCY2Z66.mjs';export{a as NDPRProvider,b as useNDPRConfig,c as useNDPRLocale}from'./chunk-FRQFU44F.mjs';export{a as defaultLocale,b as mergeLocale}from'./chunk-V5TZJJWU.mjs';import'./chunk-ZJYULEER.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunkAME4HJR4_js=require('./chunk-AME4HJR4.js');require('./chunk-RFPLZDIO.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var
|
|
2
|
+
'use strict';var 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 q={adequacy_decision:"Adequacy Decision (Section 41)",standard_clauses:"Standard Contractual Clauses (Section 42)",binding_corporate_rules:"Binding Corporate Rules (Section 43)",ndpc_authorization:"NDPC Authorization (Section 44)",explicit_consent:"Explicit Consent (Section 45(a))",contract_performance:"Contract Performance (Section 45(b))",public_interest:"Public Interest (Section 45(c))",legal_claims:"Legal Claims (Section 45(d))",vital_interests:"Vital Interests (Section 45(e))"},P={adequate:"Adequate",inadequate:"Inadequate",pending_review:"Pending Review",unknown:"Unknown"},D={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"},I={active:"ndpr-badge ndpr-badge--success",suspended:"ndpr-badge ndpr-badge--warning",terminated:"ndpr-badge ndpr-badge--neutral",pending_approval:"ndpr-badge ndpr-badge--info"},E={low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"},$=new Set(["standard_clauses","binding_corporate_rules","ndpc_authorization"]),H=({transfers:g,title:u,description:l,className:x="",classNames:r,unstyled:a,showSummary:B=true,showRiskAlerts:M=true,onTransferClick:m})=>{var h,C;let v=chunkYDKWD6MQ_js.c(),w=(h=u!=null?u:v.crossBorder.title)!=null?h:"Cross-Border Data Transfer Manager",L=(C=l!=null?l:v.crossBorder.description)!=null?C:"Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VIII (Sections 41-43).",b=react.useMemo(()=>[...g].sort((e,o)=>o.updatedAt-e.updatedAt),[g]),n=react.useMemo(()=>{var y,S,k;let e=0,o=0,s=0,A=0,T=0;for(let p of g){let f=p.status==="active";f&&(e+=1),(p.status==="pending_approval"||(y=p.ndpcApproval)!=null&&y.required&&!((S=p.ndpcApproval)!=null&&S.approved))&&(o+=1),p.riskLevel==="high"&&f&&(s+=1),!p.tiaCompleted&&f&&(A+=1),((k=p.ndpcApproval)!=null&&k.required||$.has(p.transferMechanism))&&(T+=1);}return {totalActiveTransfers:e,pendingApproval:o,highRiskTransfers:s,missingTIA:A,ndpcApprovalRequired:T}},[g]),c=typeof m=="function";return jsxRuntime.jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager-lite",className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${x}`,r==null?void 0:r.root,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",r==null?void 0:r.header,a),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,a),children:w}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:L})]}),B&&jsxRuntime.jsx("div",{role:"status","aria-label":"Transfer compliance summary",className:chunkAME4HJR4_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,a),children:[["info",n.totalActiveTransfers,"Active Transfers"],["info",n.pendingApproval,"Pending Approval"],["destructive",n.highRiskTransfers,"High Risk"],["warning",n.missingTIA,"Missing TIA"]].map(([e,o,s])=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`ndpr-alert ndpr-alert--${e}`,r==null?void 0:r.summaryCard,a),children:[jsxRuntime.jsx("p",{className:`ndpr-stat__value ndpr-text-${e}`,children:o}),jsxRuntime.jsx("p",{className:`text-sm ndpr-text-${e}`,children:s})]},s))}),M&&(n.highRiskTransfers>0||n.ndpcApprovalRequired>0)&&jsxRuntime.jsxs("div",{role:"alert","aria-label":"Cross-border transfer risk alerts",className:chunkAME4HJR4_js.a("mb-6 ndpr-alert ndpr-alert--warning",r==null?void 0:r.riskAlert,a),children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Risk alerts"}),jsxRuntime.jsxs("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:[n.highRiskTransfers>0&&jsxRuntime.jsxs("li",{children:[n.highRiskTransfers," high-risk active transfer",n.highRiskTransfers===1?"":"s"," require enhanced safeguards."]}),n.ndpcApprovalRequired>0&&jsxRuntime.jsxs("li",{children:[n.ndpcApprovalRequired," transfer",n.ndpcApprovalRequired===1?"":"s"," use a mechanism that typically requires NDPC approval."]})]})]}),jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),b.length===0?jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-left text-sm",r==null?void 0:r.table,a),"aria-label":"Cross-border transfers",children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-text-muted",r==null?void 0:r.tableHeader,a),children:jsxRuntime.jsx("tr",{children:["Destination","Recipient","Mechanism","Adequacy","Risk","Status"].map(e=>jsxRuntime.jsx("th",{className:"py-2 pr-4 font-medium",children:e},e))})}),jsxRuntime.jsx("tbody",{children:b.map(e=>{let o=c?()=>m(e):void 0;return jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a(`border-t border-gray-100 dark:border-gray-700 ${c?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,r==null?void 0:r.tableRow,a),role:c?"button":void 0,tabIndex:c?0:void 0,"aria-label":c?`View transfer to ${e.destinationCountry}`:void 0,onClick:o,onKeyDown:c?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),o());}:void 0,children:[jsxRuntime.jsxs("td",{className:"py-2 pr-4",children:[jsxRuntime.jsx("div",{className:"font-medium",children:e.destinationCountry}),e.destinationCountryCode&&jsxRuntime.jsx("div",{className:"text-xs ndpr-text-muted",children:e.destinationCountryCode})]}),jsxRuntime.jsx("td",{className:"py-2 pr-4",children:e.recipientOrganization}),jsxRuntime.jsx("td",{className:"py-2 pr-4",children:q[e.transferMechanism]}),jsxRuntime.jsx("td",{className:"py-2 pr-4",children:P[e.adequacyStatus]}),jsxRuntime.jsx("td",{className:"py-2 pr-4",children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${E[e.riskLevel]}`,r==null?void 0:r.riskBadge,a),children:[e.riskLevel.charAt(0).toUpperCase()+e.riskLevel.slice(1)," Risk"]})}),jsxRuntime.jsx("td",{className:"py-2 pr-4",children:jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${I[e.status]}`,r==null?void 0:r.statusBadge,a),children:D[e.status]})})]},e.id)})})]})})]})};exports.CrossBorderTransferManagerLite=H;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {a}from'./chunk-SFGW37LE.mjs';import'./chunk-ZJYULEER.mjs';import {useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var
|
|
2
|
+
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 q={adequacy_decision:"Adequacy Decision (Section 41)",standard_clauses:"Standard Contractual Clauses (Section 42)",binding_corporate_rules:"Binding Corporate Rules (Section 43)",ndpc_authorization:"NDPC Authorization (Section 44)",explicit_consent:"Explicit Consent (Section 45(a))",contract_performance:"Contract Performance (Section 45(b))",public_interest:"Public Interest (Section 45(c))",legal_claims:"Legal Claims (Section 45(d))",vital_interests:"Vital Interests (Section 45(e))"},P={adequate:"Adequate",inadequate:"Inadequate",pending_review:"Pending Review",unknown:"Unknown"},D={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"},I={active:"ndpr-badge ndpr-badge--success",suspended:"ndpr-badge ndpr-badge--warning",terminated:"ndpr-badge ndpr-badge--neutral",pending_approval:"ndpr-badge ndpr-badge--info"},E={low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"},$=new Set(["standard_clauses","binding_corporate_rules","ndpc_authorization"]),H=({transfers:g,title:u,description:l,className:x="",classNames:r,unstyled:a$1,showSummary:B=true,showRiskAlerts:M=true,onTransferClick:m})=>{var h,C;let v=c(),w=(h=u!=null?u:v.crossBorder.title)!=null?h:"Cross-Border Data Transfer Manager",L=(C=l!=null?l:v.crossBorder.description)!=null?C:"Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VIII (Sections 41-43).",b=useMemo(()=>[...g].sort((e,o)=>o.updatedAt-e.updatedAt),[g]),n=useMemo(()=>{var y,S,k;let e=0,o=0,s=0,A=0,T=0;for(let p of g){let f=p.status==="active";f&&(e+=1),(p.status==="pending_approval"||(y=p.ndpcApproval)!=null&&y.required&&!((S=p.ndpcApproval)!=null&&S.approved))&&(o+=1),p.riskLevel==="high"&&f&&(s+=1),!p.tiaCompleted&&f&&(A+=1),((k=p.ndpcApproval)!=null&&k.required||$.has(p.transferMechanism))&&(T+=1);}return {totalActiveTransfers:e,pendingApproval:o,highRiskTransfers:s,missingTIA:A,ndpcApprovalRequired:T}},[g]),c$1=typeof m=="function";return jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager-lite",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${x}`,r==null?void 0:r.root,a$1),children:[jsxs("div",{className:a("",r==null?void 0:r.header,a$1),children:[jsx("h2",{className:a("ndpr-section-heading",r==null?void 0:r.title,a$1),children:w}),jsx("p",{className:"ndpr-card__subtitle",children:L})]}),B&&jsx("div",{role:"status","aria-label":"Transfer compliance summary",className:a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,a$1),children:[["info",n.totalActiveTransfers,"Active Transfers"],["info",n.pendingApproval,"Pending Approval"],["destructive",n.highRiskTransfers,"High Risk"],["warning",n.missingTIA,"Missing TIA"]].map(([e,o,s])=>jsxs("div",{className:a(`ndpr-alert ndpr-alert--${e}`,r==null?void 0:r.summaryCard,a$1),children:[jsx("p",{className:`ndpr-stat__value ndpr-text-${e}`,children:o}),jsx("p",{className:`text-sm ndpr-text-${e}`,children:s})]},s))}),M&&(n.highRiskTransfers>0||n.ndpcApprovalRequired>0)&&jsxs("div",{role:"alert","aria-label":"Cross-border transfer risk alerts",className:a("mb-6 ndpr-alert ndpr-alert--warning",r==null?void 0:r.riskAlert,a$1),children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Risk alerts"}),jsxs("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:[n.highRiskTransfers>0&&jsxs("li",{children:[n.highRiskTransfers," high-risk active transfer",n.highRiskTransfers===1?"":"s"," require enhanced safeguards."]}),n.ndpcApprovalRequired>0&&jsxs("li",{children:[n.ndpcApprovalRequired," transfer",n.ndpcApprovalRequired===1?"":"s"," use a mechanism that typically requires NDPC approval."]})]})]}),jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),b.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-left text-sm",r==null?void 0:r.table,a$1),"aria-label":"Cross-border transfers",children:[jsx("thead",{className:a("ndpr-text-muted",r==null?void 0:r.tableHeader,a$1),children:jsx("tr",{children:["Destination","Recipient","Mechanism","Adequacy","Risk","Status"].map(e=>jsx("th",{className:"py-2 pr-4 font-medium",children:e},e))})}),jsx("tbody",{children:b.map(e=>{let o=c$1?()=>m(e):void 0;return jsxs("tr",{className:a(`border-t border-gray-100 dark:border-gray-700 ${c$1?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,r==null?void 0:r.tableRow,a$1),role:c$1?"button":void 0,tabIndex:c$1?0:void 0,"aria-label":c$1?`View transfer to ${e.destinationCountry}`:void 0,onClick:o,onKeyDown:c$1?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),o());}:void 0,children:[jsxs("td",{className:"py-2 pr-4",children:[jsx("div",{className:"font-medium",children:e.destinationCountry}),e.destinationCountryCode&&jsx("div",{className:"text-xs ndpr-text-muted",children:e.destinationCountryCode})]}),jsx("td",{className:"py-2 pr-4",children:e.recipientOrganization}),jsx("td",{className:"py-2 pr-4",children:q[e.transferMechanism]}),jsx("td",{className:"py-2 pr-4",children:P[e.adequacyStatus]}),jsx("td",{className:"py-2 pr-4",children:jsxs("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${E[e.riskLevel]}`,r==null?void 0:r.riskBadge,a$1),children:[e.riskLevel.charAt(0).toUpperCase()+e.riskLevel.slice(1)," Risk"]})}),jsx("td",{className:"py-2 pr-4",children:jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${I[e.status]}`,r==null?void 0:r.statusBadge,a$1),children:D[e.status]})})]},e.id)})})]})})]})};export{H as CrossBorderTransferManagerLite};
|
package/dist/cross-border.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var
|
|
2
|
+
'use strict';var chunkXYGGUGTO_js=require('./chunk-XYGGUGTO.js'),chunkHHK5LHEG_js=require('./chunk-HHK5LHEG.js'),chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js');require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-VWED6UTN.js'),require('./chunk-RFPLZDIO.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var s=react.createContext(null);function A(){let r=react.useContext(s);if(!r)throw new Error("CrossBorder compound components must be wrapped in <CrossBorder.Provider>. Example: <CrossBorder.Provider><CrossBorder.Manager /></CrossBorder.Provider>");return r}var t=({adapter:r,storageKey:d,useLocalStorage:a,initialTransfers:n,onAdd:p,onUpdate:C,onRemove:f,children:i})=>{let m=chunkHHK5LHEG_js.a({adapter:r,storageKey:d,useLocalStorage:a,initialTransfers:n,onAdd:p,onUpdate:C,onRemove:f});return jsxRuntime.jsx(s.Provider,{value:m,children:i})};var q={Provider:t,Manager:chunkXYGGUGTO_js.a};Object.defineProperty(exports,"CrossBorderTransferManager",{enumerable:true,get:function(){return chunkXYGGUGTO_js.a}});Object.defineProperty(exports,"useCrossBorderTransfer",{enumerable:true,get:function(){return chunkHHK5LHEG_js.a}});Object.defineProperty(exports,"COUNTRY_ADEQUACY_MAP",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.a}});Object.defineProperty(exports,"assessTransferRisk",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.h}});Object.defineProperty(exports,"getAdequateCountries",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.c}});Object.defineProperty(exports,"getCountryAdequacy",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.b}});Object.defineProperty(exports,"getTransferMechanismDescription",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.f}});Object.defineProperty(exports,"isNDPCApprovalRequired",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.e}});Object.defineProperty(exports,"requiresNDPCApproval",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.d}});Object.defineProperty(exports,"validateTransfer",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.g}});exports.CrossBorder=q;exports.CrossBorderProvider=t;exports.useCrossBorderCompound=A;
|
package/dist/cross-border.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {a}from'./chunk-
|
|
2
|
+
import {a}from'./chunk-42JPSNVV.mjs';export{a as CrossBorderTransferManager}from'./chunk-42JPSNVV.mjs';import {a as a$1}from'./chunk-KDAZQO3N.mjs';export{a as useCrossBorderTransfer}from'./chunk-KDAZQO3N.mjs';export{a as COUNTRY_ADEQUACY_MAP,h as assessTransferRisk,c as getAdequateCountries,b as getCountryAdequacy,f as getTransferMechanismDescription,e as isNDPCApprovalRequired,d as requiresNDPCApproval,g as validateTransfer}from'./chunk-7BJXI2HI.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-DBZSN4WP.mjs';import'./chunk-ZJYULEER.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var s=createContext(null);function A(){let r=useContext(s);if(!r)throw new Error("CrossBorder compound components must be wrapped in <CrossBorder.Provider>. Example: <CrossBorder.Provider><CrossBorder.Manager /></CrossBorder.Provider>");return r}var t=({adapter:r,storageKey:d,useLocalStorage:a,initialTransfers:n,onAdd:p,onUpdate:C,onRemove:f,children:i})=>{let m=a$1({adapter:r,storageKey:d,useLocalStorage:a,initialTransfers:n,onAdd:p,onUpdate:C,onRemove:f});return jsx(s.Provider,{value:m,children:i})};var q={Provider:t,Manager:a};export{q as CrossBorder,t as CrossBorderProvider,A as useCrossBorderCompound};
|
package/dist/dpia.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var
|
|
2
|
+
'use strict';var chunk37VFK5SR_js=require('./chunk-37VFK5SR.js'),chunkWCTFED27_js=require('./chunk-WCTFED27.js'),chunkJLQT3W3E_js=require('./chunk-JLQT3W3E.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'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var n=react.createContext(null);function v(){let o=react.useContext(n);if(!o)throw new Error("DPIA compound components must be wrapped in <DPIA.Provider>. Example: <DPIA.Provider sections={...}><DPIA.Questionnaire /></DPIA.Provider>");return o}var i=({sections:o,initialAnswers:a,adapter:m,storageKey:A,useLocalStorage:I,onComplete:D,children:d})=>{let u=chunkJLQT3W3E_js.a({sections:o,initialAnswers:a,adapter:m,storageKey:A,useLocalStorage:I,onComplete:D}),f=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},u),{sections:o});return jsxRuntime.jsx(n.Provider,{value:f,children:d})};var C={Provider:i,Questionnaire:chunkWCTFED27_js.a,Report:chunk37VFK5SR_js.a,StepIndicator:chunk37VFK5SR_js.b};Object.defineProperty(exports,"DPIAReport",{enumerable:true,get:function(){return chunk37VFK5SR_js.a}});Object.defineProperty(exports,"StepIndicator",{enumerable:true,get:function(){return chunk37VFK5SR_js.b}});Object.defineProperty(exports,"DPIAQuestionnaire",{enumerable:true,get:function(){return chunkWCTFED27_js.a}});Object.defineProperty(exports,"useDPIA",{enumerable:true,get:function(){return chunkJLQT3W3E_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkTQZWJGJ2_js.a}});exports.DPIA=C;exports.DPIAProvider=i;exports.useDPIACompound=v;
|
package/dist/dpia.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {b,a}from'./chunk-
|
|
2
|
+
import {b,a}from'./chunk-N72RNTGP.mjs';export{a as DPIAReport,b as StepIndicator}from'./chunk-N72RNTGP.mjs';import {a as a$1}from'./chunk-ZQHGIOYP.mjs';export{a as DPIAQuestionnaire}from'./chunk-ZQHGIOYP.mjs';import {a as a$2}from'./chunk-I3V3ITN7.mjs';export{a as useDPIA}from'./chunk-I3V3ITN7.mjs';export{a as assessDPIARisk}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 {b as b$1,a as a$3}from'./chunk-ZJYULEER.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var n=createContext(null);function v(){let o=useContext(n);if(!o)throw new Error("DPIA compound components must be wrapped in <DPIA.Provider>. Example: <DPIA.Provider sections={...}><DPIA.Questionnaire /></DPIA.Provider>");return o}var i=({sections:o,initialAnswers:a,adapter:m,storageKey:A,useLocalStorage:I,onComplete:D,children:d})=>{let u=a$2({sections:o,initialAnswers:a,adapter:m,storageKey:A,useLocalStorage:I,onComplete:D}),f=b$1(a$3({},u),{sections:o});return jsx(n.Provider,{value:f,children:d})};var C={Provider:i,Questionnaire:a$1,Report:a,StepIndicator:b};export{C as DPIA,i as DPIAProvider,v as useDPIACompound};
|
package/dist/dsr.d.mts
CHANGED
|
@@ -565,9 +565,18 @@ declare interface UseDSROptions {
|
|
|
565
565
|
*/
|
|
566
566
|
storageKey?: string;
|
|
567
567
|
/**
|
|
568
|
-
* Whether to use local storage to persist requests
|
|
569
|
-
*
|
|
570
|
-
*
|
|
568
|
+
* Whether to use local storage to persist requests.
|
|
569
|
+
*
|
|
570
|
+
* **Changed in 4.0:** the default is now `false`. `useDSR` is the admin
|
|
571
|
+
* tracker hook and its state contains data subjects' PII; the previous
|
|
572
|
+
* default (true) stored that PII in the admin's browser localStorage,
|
|
573
|
+
* which is rarely appropriate. Opt in by passing `useLocalStorage: true`
|
|
574
|
+
* if you specifically want the old behaviour.
|
|
575
|
+
*
|
|
576
|
+
* For production deployments, pass an explicit `adapter` instead.
|
|
577
|
+
*
|
|
578
|
+
* @default false (as of 4.0; was `true` in 3.x)
|
|
579
|
+
* @deprecated Pass an explicit `adapter` instead of toggling this flag.
|
|
571
580
|
*/
|
|
572
581
|
useLocalStorage?: boolean;
|
|
573
582
|
/**
|