@viswa-test/creative-workspace-ui-component 0.0.58 → 0.0.59

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),s=require("react"),i=require("lucide-react"),r=require("./AssignLevelAccordions.js"),t=require("./components/CustomCheckbox.js"),a=require("./assets/FileCheckCorner.js"),l=require("./styles/AssignReminderStyles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(s),c=[{label:"Edit",icon:n.jsx(i.PenLine,{size:14})},{label:"Approve",icon:n.jsx(i.UserRoundCheck,{size:14})},{label:"Edit & Approve",icon:n.jsx(a.default,{})},{label:"Notify",icon:n.jsx(i.Bell,{size:14})}];exports.AssignReminderLevels=function(s){var a,o=s.title,d=s.levels,_=void 0===d?[]:d,p=s.requireFinalApproval,f=void 0!==p&&p,g=s.additionalInfo,v=s.setLevels,x=s.setRequireFinalApproval,h=s.fetchUsers,j=s.accessLevelOptions,A=void 0===j?c:j,y=s.customInfoIcon,L=s.onValidationError,S=s.customStyles,E=void 0===S?{}:S,m=s.totalLevels,D=s.finalApprovalDueDate,I=u.default.useState(!1),b=I[0],F=I[1],R=u.default.useMemo(function(){return Array.from({length:null!=m?m:3},function(e,n){var s;return null!==(s=_[n])&&void 0!==s?s:{title:"Level ".concat(n+1),headerName:"L ".concat(n+1),isMandatory:!1,dueDate:null,assignees:[],hasDueDate:!0}})},[_,m]),T=(_.length>0?_:R).filter(function(e){return!e.isHidden});return n.jsxs("div",e.__assign({style:e.__assign({padding:"8px",display:"flex",flexDirection:"column",gap:"18px"},E.container)},{children:[n.jsxs("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_STYLES.header),E.levelsHeader)},{children:[n.jsx("span",{children:null!=o?o:"Assignee Levels"}),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_STYLES.infoIconWrapper),E.infoIconWrapper),onMouseEnter:function(){return F(!0)},onMouseLeave:function(){return F(!1)}},{children:[null!=y?y:n.jsx(i.InfoIcon,{width:18,height:18}),n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_STYLES.tooltip),E.tooltip),b?e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_STYLES.tooltipVisible),E.tooltipVisible):{})},{children:g||n.jsxs("span",{children:[n.jsx("b",{children:"How it works:"}),n.jsx("br",{}),"Level 1 is required by default, Enable Level 2 and Level 3 to add sequential approval steps for the review"]})}))]}))]})),n.jsx("div",e.__assign({style:e.__assign({display:"flex",flexDirection:"column",gap:"16px"},E.accordionsContainer)},{children:T.map(function(s,i){return n.jsx(r.default,{level:s,id:String(i),accessLevelOptions:A,fetchUsers:h,onToggleMandatory:function(){return n=i,void(null==v||v(function(s){return s.map(function(s,i){return i===n?e.__assign(e.__assign({},s),{isMandatory:!s.isMandatory}):s})}));var n},onDueDateChange:function(n){return function(n,s){var i;if(n>0&&s){var r=null===(i=_[n-1])||void 0===i?void 0:i.dueDate;if(r&&s<r)return void(null==L||L("Level ".concat(n+1," due date cannot be before Level ").concat(n," due date")))}null==v||v(function(i){return i.map(function(i,r){return r===n?e.__assign(e.__assign({},i),{dueDate:s}):i})})}(i,n)},onAssigneesChange:function(n){return s=i,t=(null!=(r=n)?r:[]).map(function(n){var s=n.role||n.accessLevel||"";return e.__assign(e.__assign({},n),{role:s,accessLevel:n.accessLevel||s})}),void(null==v||v(function(n){return n.map(function(n,i){return i===s?e.__assign(e.__assign({},n),{assignees:t}):n})}));var s,r,t},onTitleChange:function(n){return function(n,s){null==v||v(function(i){return i.map(function(i,r){return r===n?e.__assign(e.__assign({},i),{title:s}):i})})}(i,n)},finalApprovalDueDate:D},i)})})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_STYLES.finalApprovalBox),E.finalApprovalBox)},{children:[n.jsx(t.default,{getter:f,setter:null!=x?x:function(){}}),n.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:"column",alignItems:"baseline",fontSize:"14px",fontWeight:400},E.finalApprovalTextWrapper)},{children:[n.jsx("span",e.__assign({style:e.__assign({fontWeight:500},E.finalApprovalTitle)},{children:"Require Final Approval"})),n.jsx("span",e.__assign({style:E.finalApprovalDesc},{children:"After all assignees approve, you (the owner) will be notified to give final sign-off before the redline is settled."}))]}))]})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_ASSIGN_REMINDER_STYLES.currentApprovalFlow),E.currentApprovalFlow)},{children:[n.jsx("span",e.__assign({style:e.__assign({fontSize:"14px",fontWeight:600},E.currentApprovalFlowTitle)},{children:"Current Approval Flow"})),(a=_.filter(function(e){var n,s;return(null!==(s=null===(n=e.assignees)||void 0===n?void 0:n.length)&&void 0!==s?s:0)>0}),n.jsx("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginTop:"4px"},E.approvalFlowItemsWrapper)},{children:a.map(function(s,r){var t,l=s.isHidden,o=!s.isMandatory&&!l,c=s.assignees.map(function(e){return e.name}).join(" / "),d=l?n.jsx(i.User,{size:16}):function(e){switch(e){case 0:return n.jsx(i.Edit2,{size:16});case 1:return n.jsx(i.FileCheck,{size:16});case 2:return n.jsx(i.User,{size:16});default:return n.jsx(i.CheckSquare,{size:16})}}(r);return n.jsxs(u.default.Fragment,{children:[n.jsxs("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",fontWeight:500,color:o?"#64748B":"#374151",border:o?"1px dashed #CBD5E1":void 0,borderRadius:o?"6px":void 0,padding:o?"2px 6px":void 0},E.approvalFlowItem),title:s.title||"Level ".concat(r+1)},{children:[d,n.jsxs("span",{children:[c,o&&" (Optional)"]})]})),r<a.length-1&&n.jsx(i.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(t=s.id)&&void 0!==t?t:r)})})))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),s=require("react"),i=require("lucide-react"),l=require("./AssignLevelAccordions.js"),r=require("./components/CustomCheckbox.js"),a=require("./assets/FileCheckCorner.js"),t=require("./styles/AssignReminderStyles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(s),d=[{label:"Edit",icon:n.jsx(i.PenLine,{size:14})},{label:"Approve",icon:n.jsx(i.UserRoundCheck,{size:14})},{label:"Edit & Approve",icon:n.jsx(a.default,{})},{label:"Notify",icon:n.jsx(i.Bell,{size:14})}];exports.AssignReminderLevels=function(s){var a,o=s.title,c=s.levels,p=void 0===c?[]:c,_=s.requireFinalApproval,g=void 0!==_&&_,f=s.additionalInfo,v=s.setLevels,x=s.setRequireFinalApproval,h=s.fetchUsers,j=s.accessLevelOptions,A=void 0===j?d:j,y=s.customInfoIcon,m=s.onValidationError,E=s.customStyles,L=void 0===E?{}:E,S=s.totalLevels,D=s.finalApprovalDueDate,I=u.default.useState(!1),F=I[0],b=I[1],R=u.default.useMemo(function(){return Array.from({length:null!=S?S:3},function(e,n){var s;return null!==(s=p[n])&&void 0!==s?s:{title:"Level ".concat(n+1),headerName:"L ".concat(n+1),isMandatory:!1,dueDate:null,assignees:[],hasDueDate:!0}})},[p,S]),T=(p.length>0?p:R).filter(function(e){return!e.isHidden});return n.jsxs("div",e.__assign({style:e.__assign({padding:"8px",display:"flex",flexDirection:"column",gap:"18px"},L.container)},{children:[n.jsxs("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_ASSIGN_REMINDER_STYLES.header),L.levelsHeader)},{children:[n.jsx("span",{children:null!=o?o:"Assignee Levels"}),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_ASSIGN_REMINDER_STYLES.infoIconWrapper),L.infoIconWrapper),onMouseEnter:function(){return b(!0)},onMouseLeave:function(){return b(!1)}},{children:[null!=y?y:n.jsx(i.InfoIcon,{width:18,height:18}),n.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},t.DEFAULT_ASSIGN_REMINDER_STYLES.tooltip),L.tooltip),F?e.__assign(e.__assign({},t.DEFAULT_ASSIGN_REMINDER_STYLES.tooltipVisible),L.tooltipVisible):{})},{children:f||n.jsxs("span",{children:[n.jsx("b",{children:"How it works:"}),n.jsx("br",{}),"Level 1 is required by default, Enable Level 2 and Level 3 to add sequential approval steps for the review"]})}))]}))]})),n.jsx("div",e.__assign({style:e.__assign({display:"flex",flexDirection:"column",gap:"16px"},L.accordionsContainer)},{children:T.map(function(s,i){return n.jsx(l.default,{level:s,id:String(i),accessLevelOptions:A,fetchUsers:h,onToggleMandatory:function(){return n=i,void(null==v||v(function(s){return s.map(function(s,i){return i===n?e.__assign(e.__assign({},s),{isMandatory:!s.isMandatory}):s})}));var n},onDueDateChange:function(n){return function(n,s){var i;if(n>0&&s){var l=null===(i=p[n-1])||void 0===i?void 0:i.dueDate;if(l&&s<l)return void(null==m||m("Level ".concat(n+1," due date cannot be before Level ").concat(n," due date")))}null==v||v(function(i){return i.map(function(i,l){return l===n?e.__assign(e.__assign({},i),{dueDate:s}):i})})}(i,n)},onAssigneesChange:function(n){return s=i,r=(null!=(l=n)?l:[]).map(function(n){var s=n.role||n.accessLevel||"";return e.__assign(e.__assign({},n),{role:s,accessLevel:n.accessLevel||s})}),void(null==v||v(function(n){return n.map(function(n,i){return i===s?e.__assign(e.__assign({},n),{assignees:r}):n})}));var s,l,r},onTitleChange:function(n){return function(n,s){null==v||v(function(i){return i.map(function(i,l){return l===n?e.__assign(e.__assign({},i),{title:s}):i})})}(i,n)},finalApprovalDueDate:D},i)})})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_ASSIGN_REMINDER_STYLES.finalApprovalBox),L.finalApprovalBox)},{children:[n.jsx(r.default,{getter:g,setter:null!=x?x:function(){}}),n.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:"column",alignItems:"baseline",fontSize:"14px",fontWeight:400},L.finalApprovalTextWrapper)},{children:[n.jsx("span",e.__assign({style:e.__assign({fontWeight:500},L.finalApprovalTitle)},{children:"Require Final Approval"})),n.jsx("span",e.__assign({style:L.finalApprovalDesc},{children:"After all assignees approve, you (the owner) will be notified to give final sign-off before the redline is settled."}))]}))]})),n.jsxs("div",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_ASSIGN_REMINDER_STYLES.currentApprovalFlow),L.currentApprovalFlow)},{children:[n.jsx("span",e.__assign({style:e.__assign({fontSize:"14px",fontWeight:600},L.currentApprovalFlowTitle)},{children:"Current Approval Flow"})),(a=p.filter(function(e){var n,s;return(null!==(s=null===(n=e.assignees)||void 0===n?void 0:n.length)&&void 0!==s?s:0)>0}),n.jsx("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginTop:"4px"},L.approvalFlowItemsWrapper)},{children:a.map(function(s,l){var r,t,o=s.isHidden,d=!s.isMandatory&&!o,c=null!==(r=s.assignees)&&void 0!==r?r:[],p=o?n.jsx(i.User,{size:16}):function(e){switch(e){case 0:return n.jsx(i.Edit2,{size:16});case 1:return n.jsx(i.FileCheck,{size:16});case 2:return n.jsx(i.User,{size:16});default:return n.jsx(i.CheckSquare,{size:16})}}(l);return n.jsxs(u.default.Fragment,{children:[n.jsxs("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",fontWeight:500,color:d?"#64748B":"#374151",border:d?"1px dashed #CBD5E1":void 0,borderRadius:d?"6px":void 0,padding:d?"2px 6px":void 0},L.approvalFlowItem),title:s.title||"Level ".concat(l+1)},{children:[p,n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[c.map(function(s,i){var l,r,a=s.role||s.accessLevel||"No role assigned";return n.jsxs(u.default.Fragment,{children:[i>0&&n.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"/"})),n.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n.jsx("span",{children:s.name}),n.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:a}))]}))]},null!==(r=null!==(l=s.id)&&void 0!==l?l:s.email)&&void 0!==r?r:i)}),d&&n.jsx("span",{children:"(Optional)"})]}))]})),l<a.length-1&&n.jsx(i.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(t=s.id)&&void 0!==t?t:l)})})))]}))]}))};
2
2
  //# sourceMappingURL=AssignReminderLevels.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),i=require("react"),n=require("lucide-react"),t=require("../styles/ReviewStatusStyles.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=l(i),o=function(e){var s=e.trim().split(/\s+/);return 1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},a=function(e){for(var s=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return s[Math.abs(i)%s.length]},d=function(e){var s=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof s&&s.trim()?s:"No role assigned"};function c(i){var t,l=i.reviewLevel,r=l.level,o=l.assigneeStatuses,a=l.extendedStatus,d=null!==(t={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(n.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(n.Info,{size:14}),text:"Optional"}}[a])&&void 0!==t?t:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},c="approved"===a?"1px solid #D1FAE5":"rejected"===a?"1px solid #FCA5A5":"optional"===a?"1px dashed #CBD5E1":"1px solid #E5E7EB",g="approved"===a?"#F0FDF4":"rejected"===a?"#FEF2F2":"#F8FAFC";return!r.assignees||!Array.isArray(r.assignees)||r.assignees.length<1?null:s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:c,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:g,borderBottom:c,padding:"12px 16px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[s.jsx(x,{name:r.headerName}),s.jsx("span",e.__assign({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:r.title}))]})),s.jsxs("div",e.__assign({style:{backgroundColor:d.bg,color:d.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[d.icon,d.text]}))]})),s.jsx("div",e.__assign({style:{padding:"16px"}},{children:o.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:16}},{children:o.map(function(e,i){var n;return s.jsx(p,{assigneeStatus:e,extendedStatus:a},null!==(n=e.user.id)&&void 0!==n?n:i)})})):s.jsx("div",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function g(i){var t,l,r,c,g=i.reviewLevel,p=g.assigneeStatuses,x=g.extendedStatus,u=null!==(t={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(n.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(n.Info,{size:14}),text:"Optional"}}[x])&&void 0!==t?t:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},_=null===(l=p[0])||void 0===l?void 0:l.user,v=d(_);return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[_?s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:a(null!==(r=_.id)&&void 0!==r?r:_.name).bg,color:a(null!==(c=_.id)&&void 0!==c?c:_.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:o(_.name)})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:_.name})),s.jsxs("span",e.__assign({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",v]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):s.jsx("span",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),s.jsxs("div",e.__assign({style:{backgroundColor:u.bg,color:u.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[u.icon,u.text]}))]}))}function p(i){var t,l=i.assigneeStatus,r=i.extendedStatus,c=l.user,g=l.approved||"approved"===c.action,p=l.rejected||"rejected"===c.action,x=o(c.name),u=a(null!==(t=c.id)&&void 0!==t?t:c.name),_=d(c);return s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:u.bg,color:u.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:x})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:c.name})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:c.email})),s.jsxs("span",e.__assign({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",_]}))]}))]})),s.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:g?s.jsx(n.CircleCheck,{size:20,color:"#16A34A",strokeWidth:1.5}):p?s.jsx(n.X,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===r?s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontSize:"13px",color:"#4B5563"}}),s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):"optional"===r?s.jsx(n.MinusCircle,{size:20,color:"#CBD5E1",strokeWidth:1.5}):s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function x(i){var n=i.name,t=a(n);return s.jsx("span",e.__assign({style:{backgroundColor:t.bg,color:t.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var u=function(e){switch(e){case 0:return s.jsx(n.LucidePen,{size:16,color:"#475569"});case 1:return s.jsx(n.FileCheck,{size:16,color:"#475569"});case 2:return s.jsx(n.User,{size:16,color:"#475569"});default:return s.jsx(n.CheckCircle,{size:16,color:"#475569"})}};function _(i){var l=i.levels,o=l.some(function(e){var s,i;return(null!==(i=null===(s=e.assignees)||void 0===s?void 0:s.length)&&void 0!==i?i:0)>0});return s.jsxs("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowBox},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowTitle},{children:"Current Approval Flow"})),o?s.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:l.map(function(i,o){var a,c=i.isHidden,g=!i.isMandatory&&!c,p=null===(a=i.assignees)||void 0===a?void 0:a.map(function(e){return"".concat(e.name," (").concat(d(e),")")}).join(" / ");if(!p)return null;var x=c?s.jsx(n.User,{size:16,color:"#475569"}):u(o);return s.jsxs(r.default.Fragment,{children:[s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.flowChip),{display:"flex",alignItems:"center",gap:"6px",border:g?"1px dashed #CBD5E1":void 0})},{children:[x,s.jsxs("span",e.__assign({style:{fontSize:13,color:g?"#64748B":"#374151"}},{children:[p," ",g&&"(Optional)"]}))]})),o<l.length-1&&s.jsx(n.ArrowRight,{size:16,color:"#9CA3AF"})]},o)})})):s.jsx("p",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowEmpty},{children:"No owners assigned yet."}))]}))}exports.default=function(i){var l=i.levels,o=i.reviewData,a=void 0===o?{}:o,d=l.map(function(e,s){var i,n,t,l=null!==(n=null!==(i=a[s])&&void 0!==i?i:a[e.headerName])&&void 0!==n?n:{},r=(null!==(t=e.assignees)&&void 0!==t?t:[]).map(function(e){return{user:e,approved:!0===l[String(e.id)]||!0===l[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===l[String(e.id)]||"rejected"===l[String(e.email)]||"rejected"===e.action}}),o="not_started";if(!0===e.isApproved)o="approved";else if(!0===e.isRejected)o="rejected";else if("approved"===e.status||"completed"===e.status)o="approved";else if("rejected"===e.status)o="rejected";else{var d=r.length>0&&r.every(function(e){return e.approved}),c=r.some(function(e){return e.rejected});d?o="approved":c&&(o="rejected")}return{level:e,assigneeStatuses:r,status:o}}),p=!1,x=d.map(function(s){var i="waiting",n=!0===s.level.isHidden;return"approved"===s.status?i="approved":"rejected"===s.status?(i="rejected",p=!0):s.level.isMandatory||n?p||(i="pending",p=!0):i="optional",e.__assign(e.__assign({},s),{extendedStatus:i,isFinalApproval:n})}),u=function(e){return e.filter(function(e){return"approved"===e.status}).length}(d),v=d.length;return s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:24}},{children:[s.jsxs("div",{children:[s.jsxs("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressHeader},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressTitle},{children:"Approval Progress"})),s.jsxs("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressCount},{children:[u," of ",v," level",1!==v?"s":""," complete"]}))]})),s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressBarTrack},{children:x.map(function(i,n){var l,r="approved"===i.extendedStatus,o="rejected"===i.extendedStatus,a="optional"===i.extendedStatus,d=0===n,c=n===v-1;return!(null===(l=i.level)||void 0===l?void 0:l.assignees)||!Array.isArray(i.level.assignees)||i.level.assignees.length<1?null:s.jsx("div",{style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.progressSegment),{backgroundColor:r?"#6366F1":o?"#EF4444":a?"#F1F5F9":"#E5E7EB",borderRadius:d&&c?"999px":d?"999px 0 0 999px":c?"0 999px 999px 0":"0",marginRight:c?0:3})},n)})})),s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressLabels},{children:x.map(function(i,n){return s.jsx("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.progressLabel),{color:"approved"===i.extendedStatus?"#6366F1":"rejected"===i.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===i.extendedStatus||"rejected"===i.extendedStatus?600:400})},{children:i.level.assignees&&i.level.assignees.length>0?"".concat(i.level.headerName," - ").concat(i.level.title):""}),n)})}))]}),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:0}},{children:[s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.sectionHeadingRow},{children:s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.sectionTitle},{children:"Approval Levels"})),s.jsx(n.Info,{size:15,color:"#9CA3AF"})]}))})),s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:x.map(function(i,n){var t,l=n===x.length-1,o=i.isFinalApproval,a=x[n+1],d=null==a?void 0:a.isFinalApproval,p=a&&!a.level.isMandatory&&!d;return o?s.jsxs(r.default.Fragment,{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),s.jsx("div",e.__assign({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),s.jsx(g,{reviewLevel:i})]},n):s.jsxs(r.default.Fragment,{children:[s.jsx(c,{reviewLevel:i}),!l&&!d&&a.level.assignees&&(null===(t=a.level.assignees)||void 0===t?void 0:t.length)>0&&s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:p?"optional":"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},n)})}))]})),s.jsx(_,{levels:l})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),i=require("react"),n=require("lucide-react"),t=require("../styles/ReviewStatusStyles.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=l(i),a=function(e){var s=e.trim().split(/\s+/);return 1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},o=function(e){for(var s=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return s[Math.abs(i)%s.length]},d=function(e){var s=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof s&&s.trim()?s:"No role assigned"};function p(i){var t,l=i.reviewLevel,r=l.level,a=l.assigneeStatuses,o=l.extendedStatus,d=null!==(t={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(n.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(n.Info,{size:14}),text:"Optional"}}[o])&&void 0!==t?t:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},p="approved"===o?"1px solid #D1FAE5":"rejected"===o?"1px solid #FCA5A5":"optional"===o?"1px dashed #CBD5E1":"1px solid #E5E7EB",c="approved"===o?"#F0FDF4":"rejected"===o?"#FEF2F2":"#F8FAFC";return!r.assignees||!Array.isArray(r.assignees)||r.assignees.length<1?null:s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:p,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:c,borderBottom:p,padding:"12px 16px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[s.jsx(x,{name:r.headerName}),s.jsx("span",e.__assign({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:r.title}))]})),s.jsxs("div",e.__assign({style:{backgroundColor:d.bg,color:d.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[d.icon,d.text]}))]})),s.jsx("div",e.__assign({style:{padding:"16px"}},{children:a.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:16}},{children:a.map(function(e,i){var n;return s.jsx(g,{assigneeStatus:e,extendedStatus:o},null!==(n=e.user.id)&&void 0!==n?n:i)})})):s.jsx("div",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function c(i){var t,l,r,p,c=i.reviewLevel,g=c.assigneeStatuses,x=c.extendedStatus,u=null!==(t={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(n.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(n.Info,{size:14}),text:"Optional"}}[x])&&void 0!==t?t:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},_=null===(l=g[0])||void 0===l?void 0:l.user,v=d(_);return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[_?s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:o(null!==(r=_.id)&&void 0!==r?r:_.name).bg,color:o(null!==(p=_.id)&&void 0!==p?p:_.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:a(_.name)})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:_.name})),s.jsxs("span",e.__assign({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",v]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):s.jsx("span",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),s.jsxs("div",e.__assign({style:{backgroundColor:u.bg,color:u.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[u.icon,u.text]}))]}))}function g(i){var t,l=i.assigneeStatus,r=i.extendedStatus,p=l.user,c=l.approved||"approved"===p.action,g=l.rejected||"rejected"===p.action,x=a(p.name),u=o(null!==(t=p.id)&&void 0!==t?t:p.name),_=d(p);return s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:u.bg,color:u.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:x})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:p.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:_}))]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:p.email}))]}))]})),s.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:c?s.jsx(n.CircleCheck,{size:20,color:"#16A34A",strokeWidth:1.5}):g?s.jsx(n.X,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===r?s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontSize:"13px",color:"#4B5563"}}),s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):"optional"===r?s.jsx(n.MinusCircle,{size:20,color:"#CBD5E1",strokeWidth:1.5}):s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function x(i){var n=i.name,t=o(n);return s.jsx("span",e.__assign({style:{backgroundColor:t.bg,color:t.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var u=function(e){switch(e){case 0:return s.jsx(n.LucidePen,{size:16,color:"#475569"});case 1:return s.jsx(n.FileCheck,{size:16,color:"#475569"});case 2:return s.jsx(n.User,{size:16,color:"#475569"});default:return s.jsx(n.CheckCircle,{size:16,color:"#475569"})}};function _(i){var l=i.levels.filter(function(e){var s,i;return(null!==(i=null===(s=e.assignees)||void 0===s?void 0:s.length)&&void 0!==i?i:0)>0});return s.jsxs("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowBox},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowTitle},{children:"Current Approval Flow"})),l.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:l.map(function(i,a){var o,p=i.isHidden,c=!i.isMandatory&&!p,g=p?s.jsx(n.User,{size:16,color:"#475569"}):u(a);return s.jsxs(r.default.Fragment,{children:[s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:c?"1px dashed #CBD5E1":void 0})},{children:[g,s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[i.assignees.map(function(i,n){var t,l,a=d(i);return s.jsxs(r.default.Fragment,{children:[n>0&&s.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"/"})),s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:13,color:c?"#64748B":"#374151"}},{children:i.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:a}))]}))]},null!==(l=null!==(t=i.id)&&void 0!==t?t:i.email)&&void 0!==l?l:n)}),c&&s.jsx("span",e.__assign({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),a<l.length-1&&s.jsx(n.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(o=i.id)&&void 0!==o?o:"".concat(i.headerName,"-").concat(a))})})):s.jsx("p",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowEmpty},{children:"No owners assigned yet."}))]}))}exports.default=function(i){var l=i.levels,a=i.reviewData,o=void 0===a?{}:a,d=l.map(function(e,s){var i,n,t,l=null!==(n=null!==(i=o[s])&&void 0!==i?i:o[e.headerName])&&void 0!==n?n:{},r=(null!==(t=e.assignees)&&void 0!==t?t:[]).map(function(e){return{user:e,approved:!0===l[String(e.id)]||!0===l[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===l[String(e.id)]||"rejected"===l[String(e.email)]||"rejected"===e.action}}),a="not_started";if(!0===e.isApproved)a="approved";else if(!0===e.isRejected)a="rejected";else if("approved"===e.status||"completed"===e.status)a="approved";else if("rejected"===e.status)a="rejected";else{var d=r.length>0&&r.every(function(e){return e.approved}),p=r.some(function(e){return e.rejected});d?a="approved":p&&(a="rejected")}return{level:e,assigneeStatuses:r,status:a}}),g=!1,x=d.map(function(s){var i="waiting",n=!0===s.level.isHidden;return"approved"===s.status?i="approved":"rejected"===s.status?(i="rejected",g=!0):s.level.isMandatory||n?g||(i="pending",g=!0):i="optional",e.__assign(e.__assign({},s),{extendedStatus:i,isFinalApproval:n})}),u=function(e){return e.filter(function(e){return"approved"===e.status}).length}(d),v=d.length;return s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:24}},{children:[s.jsxs("div",{children:[s.jsxs("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressHeader},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressTitle},{children:"Approval Progress"})),s.jsxs("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressCount},{children:[u," of ",v," level",1!==v?"s":""," complete"]}))]})),s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressBarTrack},{children:x.map(function(i,n){var l,r="approved"===i.extendedStatus,a="rejected"===i.extendedStatus,o="optional"===i.extendedStatus,d=0===n,p=n===v-1;return!(null===(l=i.level)||void 0===l?void 0:l.assignees)||!Array.isArray(i.level.assignees)||i.level.assignees.length<1?null:s.jsx("div",{style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.progressSegment),{backgroundColor:r?"#6366F1":a?"#EF4444":o?"#F1F5F9":"#E5E7EB",borderRadius:d&&p?"999px":d?"999px 0 0 999px":p?"0 999px 999px 0":"0",marginRight:p?0:3})},n)})})),s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressLabels},{children:x.map(function(i,n){return s.jsx("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.progressLabel),{color:"approved"===i.extendedStatus?"#6366F1":"rejected"===i.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===i.extendedStatus||"rejected"===i.extendedStatus?600:400})},{children:i.level.assignees&&i.level.assignees.length>0?"".concat(i.level.headerName," - ").concat(i.level.title):""}),n)})}))]}),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:0}},{children:[s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.sectionHeadingRow},{children:s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.sectionTitle},{children:"Approval Levels"})),s.jsx(n.Info,{size:15,color:"#9CA3AF"})]}))})),s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:x.map(function(i,n){var t,l=n===x.length-1,a=i.isFinalApproval,o=x[n+1],d=null==o?void 0:o.isFinalApproval,g=o&&!o.level.isMandatory&&!d;return a?s.jsxs(r.default.Fragment,{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),s.jsx("div",e.__assign({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),s.jsx(c,{reviewLevel:i})]},n):s.jsxs(r.default.Fragment,{children:[s.jsx(p,{reviewLevel:i}),!l&&!d&&o.level.assignees&&(null===(t=o.level.assignees)||void 0===t?void 0:t.length)>0&&s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:g?"optional":"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},n)})}))]})),s.jsx(_,{levels:l})]}))};
2
2
  //# sourceMappingURL=ReviewStatus.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"../../_virtual/_tslib.js";import{jsx as n,jsxs as i}from"react/jsx-runtime";import t from"react";import{PenLine as r,UserRoundCheck as l,Bell as o,InfoIcon as a,User as s,ArrowRight as p,CheckSquare as c,FileCheck as u,Edit2 as d}from"lucide-react";import f from"./AssignLevelAccordions.js";import v from"./components/CustomCheckbox.js";import h from"./assets/FileCheckCorner.js";import{DEFAULT_ASSIGN_REMINDER_STYLES as m}from"./styles/AssignReminderStyles.js";var g=[{label:"Edit",icon:n(r,{size:14})},{label:"Approve",icon:n(l,{size:14})},{label:"Edit & Approve",icon:n(h,{})},{label:"Notify",icon:n(o,{size:14})}];function y(r){var l,o=r.title,h=r.levels,y=void 0===h?[]:h,x=r.requireFinalApproval,A=void 0!==x&&x,b=r.additionalInfo,L=r.setLevels,D=r.setRequireFinalApproval,w=r.fetchUsers,z=r.accessLevelOptions,F=void 0===z?g:z,C=r.customInfoIcon,I=r.onValidationError,W=r.customStyles,M=void 0===W?{}:W,j=r.totalLevels,S=r.finalApprovalDueDate,E=t.useState(!1),T=E[0],q=E[1],B=t.useMemo(function(){return Array.from({length:null!=j?j:3},function(e,n){var i;return null!==(i=y[n])&&void 0!==i?i:{title:"Level ".concat(n+1),headerName:"L ".concat(n+1),isMandatory:!1,dueDate:null,assignees:[],hasDueDate:!0}})},[y,j]),H=(y.length>0?y:B).filter(function(e){return!e.isHidden});return i("div",e({style:e({padding:"8px",display:"flex",flexDirection:"column",gap:"18px"},M.container)},{children:[i("span",e({style:e(e({},m.header),M.levelsHeader)},{children:[n("span",{children:null!=o?o:"Assignee Levels"}),i("div",e({style:e(e({},m.infoIconWrapper),M.infoIconWrapper),onMouseEnter:function(){return q(!0)},onMouseLeave:function(){return q(!1)}},{children:[null!=C?C:n(a,{width:18,height:18}),n("div",e({style:e(e(e({},m.tooltip),M.tooltip),T?e(e({},m.tooltipVisible),M.tooltipVisible):{})},{children:b||i("span",{children:[n("b",{children:"How it works:"}),n("br",{}),"Level 1 is required by default, Enable Level 2 and Level 3 to add sequential approval steps for the review"]})}))]}))]})),n("div",e({style:e({display:"flex",flexDirection:"column",gap:"16px"},M.accordionsContainer)},{children:H.map(function(i,t){return n(f,{level:i,id:String(t),accessLevelOptions:F,fetchUsers:w,onToggleMandatory:function(){return n=t,void(null==L||L(function(i){return i.map(function(i,t){return t===n?e(e({},i),{isMandatory:!i.isMandatory}):i})}));var n},onDueDateChange:function(n){return function(n,i){var t;if(n>0&&i){var r=null===(t=y[n-1])||void 0===t?void 0:t.dueDate;if(r&&i<r)return void(null==I||I("Level ".concat(n+1," due date cannot be before Level ").concat(n," due date")))}null==L||L(function(t){return t.map(function(t,r){return r===n?e(e({},t),{dueDate:i}):t})})}(t,n)},onAssigneesChange:function(n){return i=t,l=(null!=(r=n)?r:[]).map(function(n){var i=n.role||n.accessLevel||"";return e(e({},n),{role:i,accessLevel:n.accessLevel||i})}),void(null==L||L(function(n){return n.map(function(n,t){return t===i?e(e({},n),{assignees:l}):n})}));var i,r,l},onTitleChange:function(n){return function(n,i){null==L||L(function(t){return t.map(function(t,r){return r===n?e(e({},t),{title:i}):t})})}(t,n)},finalApprovalDueDate:S},t)})})),i("div",e({style:e(e({},m.finalApprovalBox),M.finalApprovalBox)},{children:[n(v,{getter:A,setter:null!=D?D:function(){}}),i("div",e({style:e({display:"flex",flexDirection:"column",alignItems:"baseline",fontSize:"14px",fontWeight:400},M.finalApprovalTextWrapper)},{children:[n("span",e({style:e({fontWeight:500},M.finalApprovalTitle)},{children:"Require Final Approval"})),n("span",e({style:M.finalApprovalDesc},{children:"After all assignees approve, you (the owner) will be notified to give final sign-off before the redline is settled."}))]}))]})),i("div",e({style:e(e({},m.currentApprovalFlow),M.currentApprovalFlow)},{children:[n("span",e({style:e({fontSize:"14px",fontWeight:600},M.currentApprovalFlowTitle)},{children:"Current Approval Flow"})),(l=y.filter(function(e){var n,i;return(null!==(i=null===(n=e.assignees)||void 0===n?void 0:n.length)&&void 0!==i?i:0)>0}),n("div",e({style:e({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginTop:"4px"},M.approvalFlowItemsWrapper)},{children:l.map(function(r,o){var a,f=r.isHidden,v=!r.isMandatory&&!f,h=r.assignees.map(function(e){return e.name}).join(" / "),m=f?n(s,{size:16}):function(e){switch(e){case 0:return n(d,{size:16});case 1:return n(u,{size:16});case 2:return n(s,{size:16});default:return n(c,{size:16})}}(o);return i(t.Fragment,{children:[i("div",e({style:e({display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",fontWeight:500,color:v?"#64748B":"#374151",border:v?"1px dashed #CBD5E1":void 0,borderRadius:v?"6px":void 0,padding:v?"2px 6px":void 0},M.approvalFlowItem),title:r.title||"Level ".concat(o+1)},{children:[m,i("span",{children:[h,v&&" (Optional)"]})]})),o<l.length-1&&n(p,{size:16,color:"#9CA3AF"})]},null!==(a=r.id)&&void 0!==a?a:o)})})))]}))]}))}export{y as AssignReminderLevels};
1
+ import{__assign as e}from"../../_virtual/_tslib.js";import{jsx as n,jsxs as i}from"react/jsx-runtime";import l from"react";import{PenLine as r,UserRoundCheck as t,Bell as o,InfoIcon as a,User as s,ArrowRight as p,CheckSquare as c,FileCheck as d,Edit2 as u}from"lucide-react";import f from"./AssignLevelAccordions.js";import v from"./components/CustomCheckbox.js";import h from"./assets/FileCheckCorner.js";import{DEFAULT_ASSIGN_REMINDER_STYLES as g}from"./styles/AssignReminderStyles.js";var m=[{label:"Edit",icon:n(r,{size:14})},{label:"Approve",icon:n(t,{size:14})},{label:"Edit & Approve",icon:n(h,{})},{label:"Notify",icon:n(o,{size:14})}];function x(r){var t,o=r.title,h=r.levels,x=void 0===h?[]:h,y=r.requireFinalApproval,A=void 0!==y&&y,b=r.additionalInfo,L=r.setLevels,F=r.setRequireFinalApproval,D=r.fetchUsers,w=r.accessLevelOptions,z=void 0===w?m:w,C=r.customInfoIcon,I=r.onValidationError,W=r.customStyles,E=void 0===W?{}:W,M=r.totalLevels,S=r.finalApprovalDueDate,j=l.useState(!1),T=j[0],q=j[1],H=l.useMemo(function(){return Array.from({length:null!=M?M:3},function(e,n){var i;return null!==(i=x[n])&&void 0!==i?i:{title:"Level ".concat(n+1),headerName:"L ".concat(n+1),isMandatory:!1,dueDate:null,assignees:[],hasDueDate:!0}})},[x,M]),R=(x.length>0?x:H).filter(function(e){return!e.isHidden});return i("div",e({style:e({padding:"8px",display:"flex",flexDirection:"column",gap:"18px"},E.container)},{children:[i("span",e({style:e(e({},g.header),E.levelsHeader)},{children:[n("span",{children:null!=o?o:"Assignee Levels"}),i("div",e({style:e(e({},g.infoIconWrapper),E.infoIconWrapper),onMouseEnter:function(){return q(!0)},onMouseLeave:function(){return q(!1)}},{children:[null!=C?C:n(a,{width:18,height:18}),n("div",e({style:e(e(e({},g.tooltip),E.tooltip),T?e(e({},g.tooltipVisible),E.tooltipVisible):{})},{children:b||i("span",{children:[n("b",{children:"How it works:"}),n("br",{}),"Level 1 is required by default, Enable Level 2 and Level 3 to add sequential approval steps for the review"]})}))]}))]})),n("div",e({style:e({display:"flex",flexDirection:"column",gap:"16px"},E.accordionsContainer)},{children:R.map(function(i,l){return n(f,{level:i,id:String(l),accessLevelOptions:z,fetchUsers:D,onToggleMandatory:function(){return n=l,void(null==L||L(function(i){return i.map(function(i,l){return l===n?e(e({},i),{isMandatory:!i.isMandatory}):i})}));var n},onDueDateChange:function(n){return function(n,i){var l;if(n>0&&i){var r=null===(l=x[n-1])||void 0===l?void 0:l.dueDate;if(r&&i<r)return void(null==I||I("Level ".concat(n+1," due date cannot be before Level ").concat(n," due date")))}null==L||L(function(l){return l.map(function(l,r){return r===n?e(e({},l),{dueDate:i}):l})})}(l,n)},onAssigneesChange:function(n){return i=l,t=(null!=(r=n)?r:[]).map(function(n){var i=n.role||n.accessLevel||"";return e(e({},n),{role:i,accessLevel:n.accessLevel||i})}),void(null==L||L(function(n){return n.map(function(n,l){return l===i?e(e({},n),{assignees:t}):n})}));var i,r,t},onTitleChange:function(n){return function(n,i){null==L||L(function(l){return l.map(function(l,r){return r===n?e(e({},l),{title:i}):l})})}(l,n)},finalApprovalDueDate:S},l)})})),i("div",e({style:e(e({},g.finalApprovalBox),E.finalApprovalBox)},{children:[n(v,{getter:A,setter:null!=F?F:function(){}}),i("div",e({style:e({display:"flex",flexDirection:"column",alignItems:"baseline",fontSize:"14px",fontWeight:400},E.finalApprovalTextWrapper)},{children:[n("span",e({style:e({fontWeight:500},E.finalApprovalTitle)},{children:"Require Final Approval"})),n("span",e({style:E.finalApprovalDesc},{children:"After all assignees approve, you (the owner) will be notified to give final sign-off before the redline is settled."}))]}))]})),i("div",e({style:e(e({},g.currentApprovalFlow),E.currentApprovalFlow)},{children:[n("span",e({style:e({fontSize:"14px",fontWeight:600},E.currentApprovalFlowTitle)},{children:"Current Approval Flow"})),(t=x.filter(function(e){var n,i;return(null!==(i=null===(n=e.assignees)||void 0===n?void 0:n.length)&&void 0!==i?i:0)>0}),n("div",e({style:e({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginTop:"4px"},E.approvalFlowItemsWrapper)},{children:t.map(function(r,o){var a,f,v=r.isHidden,h=!r.isMandatory&&!v,g=null!==(a=r.assignees)&&void 0!==a?a:[],m=v?n(s,{size:16}):function(e){switch(e){case 0:return n(u,{size:16});case 1:return n(d,{size:16});case 2:return n(s,{size:16});default:return n(c,{size:16})}}(o);return i(l.Fragment,{children:[i("div",e({style:e({display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",fontWeight:500,color:h?"#64748B":"#374151",border:h?"1px dashed #CBD5E1":void 0,borderRadius:h?"6px":void 0,padding:h?"2px 6px":void 0},E.approvalFlowItem),title:r.title||"Level ".concat(o+1)},{children:[m,i("span",e({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[g.map(function(r,t){var o,a,s=r.role||r.accessLevel||"No role assigned";return i(l.Fragment,{children:[t>0&&n("span",e({style:{color:"#9CA3AF"}},{children:"/"})),i("span",e({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n("span",{children:r.name}),n("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:s}))]}))]},null!==(a=null!==(o=r.id)&&void 0!==o?o:r.email)&&void 0!==a?a:t)}),h&&n("span",{children:"(Optional)"})]}))]})),o<t.length-1&&n(p,{size:16,color:"#9CA3AF"})]},null!==(f=r.id)&&void 0!==f?f:o)})})))]}))]}))}export{x as AssignReminderLevels};
2
2
  //# sourceMappingURL=AssignReminderLevels.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as i,Fragment as n}from"react/jsx-runtime";import l from"react";import{Info as r,Check as o,Hourglass as s,X as d,CircleCheck as a,MinusCircle as p,User as c,ArrowRight as g,CheckCircle as v,FileCheck as u,LucidePen as f}from"lucide-react";import{DEFAULT_REVIEW_STATUS_STYLES as x}from"../styles/ReviewStatusStyles.js";var h=function(e){var t=e.trim().split(/\s+/);return 1===t.length?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()},y=function(e){for(var t=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return t[Math.abs(i)%t.length]},F=function(e){var t=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof t&&t.trim()?t:"No role assigned"};function m(n){var o=n.levels,s=n.reviewData,d=void 0===s?{}:s,a=o.map(function(e,t){var i,n,l,r=null!==(n=null!==(i=d[t])&&void 0!==i?i:d[e.headerName])&&void 0!==n?n:{},o=(null!==(l=e.assignees)&&void 0!==l?l:[]).map(function(e){return{user:e,approved:!0===r[String(e.id)]||!0===r[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===r[String(e.id)]||"rejected"===r[String(e.email)]||"rejected"===e.action}}),s="not_started";if(!0===e.isApproved)s="approved";else if(!0===e.isRejected)s="rejected";else if("approved"===e.status||"completed"===e.status)s="approved";else if("rejected"===e.status)s="rejected";else{var a=o.length>0&&o.every(function(e){return e.approved}),p=o.some(function(e){return e.rejected});a?s="approved":p&&(s="rejected")}return{level:e,assigneeStatuses:o,status:s}}),p=!1,c=a.map(function(t){var i="waiting",n=!0===t.level.isHidden;return"approved"===t.status?i="approved":"rejected"===t.status?(i="rejected",p=!0):t.level.isMandatory||n?p||(i="pending",p=!0):i="optional",e(e({},t),{extendedStatus:i,isFinalApproval:n})}),g=function(e){return e.filter(function(e){return"approved"===e.status}).length}(a),v=a.length;return t("div",e({style:{display:"flex",flexDirection:"column",gap:24}},{children:[t("div",{children:[t("div",e({style:x.progressHeader},{children:[i("span",e({style:x.progressTitle},{children:"Approval Progress"})),t("span",e({style:x.progressCount},{children:[g," of ",v," level",1!==v?"s":""," complete"]}))]})),i("div",e({style:x.progressBarTrack},{children:c.map(function(t,n){var l,r="approved"===t.extendedStatus,o="rejected"===t.extendedStatus,s="optional"===t.extendedStatus,d=0===n,a=n===v-1;return!(null===(l=t.level)||void 0===l?void 0:l.assignees)||!Array.isArray(t.level.assignees)||t.level.assignees.length<1?null:i("div",{style:e(e({},x.progressSegment),{backgroundColor:r?"#6366F1":o?"#EF4444":s?"#F1F5F9":"#E5E7EB",borderRadius:d&&a?"999px":d?"999px 0 0 999px":a?"0 999px 999px 0":"0",marginRight:a?0:3})},n)})})),i("div",e({style:x.progressLabels},{children:c.map(function(t,n){return i("span",e({style:e(e({},x.progressLabel),{color:"approved"===t.extendedStatus?"#6366F1":"rejected"===t.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===t.extendedStatus||"rejected"===t.extendedStatus?600:400})},{children:t.level.assignees&&t.level.assignees.length>0?"".concat(t.level.headerName," - ").concat(t.level.title):""}),n)})}))]}),t("div",e({style:{display:"flex",flexDirection:"column",gap:0}},{children:[i("div",e({style:x.sectionHeadingRow},{children:t("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",e({style:x.sectionTitle},{children:"Approval Levels"})),i(r,{size:15,color:"#9CA3AF"})]}))})),i("div",e({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:c.map(function(n,r){var o,s=r===c.length-1,d=n.isFinalApproval,a=c[r+1],p=null==a?void 0:a.isFinalApproval,g=a&&!a.level.isMandatory&&!p;return t(l.Fragment,d?{children:[t("div",e({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),i("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),i("div",e({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),i(E,{reviewLevel:n})]}:{children:[i(b,{reviewLevel:n}),!s&&!p&&a.level.assignees&&(null===(o=a.level.assignees)||void 0===o?void 0:o.length)>0&&t("div",e({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),i("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:g?"optional":"then"})),i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},r)})}))]})),i(A,{levels:o})]}))}function b(n){var l,a=n.reviewLevel,p=a.level,c=a.assigneeStatuses,g=a.extendedStatus,v=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:i(o,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:i(s,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:i(d,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:i(r,{size:14}),text:"Optional"}}[g])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},u="approved"===g?"1px solid #D1FAE5":"rejected"===g?"1px solid #FCA5A5":"optional"===g?"1px dashed #CBD5E1":"1px solid #E5E7EB",f="approved"===g?"#F0FDF4":"rejected"===g?"#FEF2F2":"#F8FAFC";return!p.assignees||!Array.isArray(p.assignees)||p.assignees.length<1?null:t("div",e({style:{backgroundColor:"#FFFFFF",border:u,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[t("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:f,borderBottom:u,padding:"12px 16px"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[i(z,{name:p.headerName}),i("span",e({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:p.title}))]})),t("div",e({style:{backgroundColor:v.bg,color:v.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[v.icon,v.text]}))]})),i("div",e({style:{padding:"16px"}},{children:c.length>0?i("div",e({style:{display:"flex",flexDirection:"column",gap:16}},{children:c.map(function(e,t){var n;return i(C,{assigneeStatus:e,extendedStatus:g},null!==(n=e.user.id)&&void 0!==n?n:t)})})):i("div",e({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function E(n){var l,a,p,c,g=n.reviewLevel,v=g.assigneeStatuses,u=g.extendedStatus,f=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:i(o,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:i(s,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:i(d,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:i(r,{size:14}),text:"Optional"}}[u])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},x=null===(a=v[0])||void 0===a?void 0:a.user,m=F(x);return t("div",e({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[x?t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[i("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:y(null!==(p=x.id)&&void 0!==p?p:x.name).bg,color:y(null!==(c=x.id)&&void 0!==c?c:x.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:h(x.name)})),t("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[i("span",e({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:x.name})),t("span",e({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",m]})),i("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):i("span",e({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),t("div",e({style:{backgroundColor:f.bg,color:f.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[f.icon,f.text]}))]}))}function C(l){var r,o=l.assigneeStatus,s=l.extendedStatus,c=o.user,g=o.approved||"approved"===c.action,v=o.rejected||"rejected"===c.action,u=h(c.name),f=y(null!==(r=c.id)&&void 0!==r?r:c.name),x=F(c);return t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[i("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:f.bg,color:f.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:u})),t("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[i("span",e({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:c.name})),i("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:c.email})),t("span",e({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",x]}))]}))]})),i("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:g?i(a,{size:20,color:"#16A34A",strokeWidth:1.5}):v?i(d,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===s?t(n,{children:[i("span",{style:{fontSize:"13px",color:"#4B5563"}}),i(p,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):i(p,"optional"===s?{size:20,color:"#CBD5E1",strokeWidth:1.5}:{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function z(t){var n=t.name,l=y(n);return i("span",e({style:{backgroundColor:l.bg,color:l.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var S=function(e){switch(e){case 0:return i(f,{size:16,color:"#475569"});case 1:return i(u,{size:16,color:"#475569"});case 2:return i(c,{size:16,color:"#475569"});default:return i(v,{size:16,color:"#475569"})}};function A(n){var r=n.levels,o=r.some(function(e){var t,i;return(null!==(i=null===(t=e.assignees)||void 0===t?void 0:t.length)&&void 0!==i?i:0)>0});return t("div",e({style:x.flowBox},{children:[i("span",e({style:x.flowTitle},{children:"Current Approval Flow"})),o?i("div",e({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:r.map(function(n,o){var s,d=n.isHidden,a=!n.isMandatory&&!d,p=null===(s=n.assignees)||void 0===s?void 0:s.map(function(e){return"".concat(e.name," (").concat(F(e),")")}).join(" / ");if(!p)return null;var v=d?i(c,{size:16,color:"#475569"}):S(o);return t(l.Fragment,{children:[t("span",e({style:e(e({},x.flowChip),{display:"flex",alignItems:"center",gap:"6px",border:a?"1px dashed #CBD5E1":void 0})},{children:[v,t("span",e({style:{fontSize:13,color:a?"#64748B":"#374151"}},{children:[p," ",a&&"(Optional)"]}))]})),o<r.length-1&&i(g,{size:16,color:"#9CA3AF"})]},o)})})):i("p",e({style:x.flowEmpty},{children:"No owners assigned yet."}))]}))}export{m as default};
1
+ import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as i,Fragment as n}from"react/jsx-runtime";import l from"react";import{Info as r,Check as o,Hourglass as s,X as d,CircleCheck as a,MinusCircle as p,User as c,ArrowRight as g,CheckCircle as v,FileCheck as u,LucidePen as x}from"lucide-react";import{DEFAULT_REVIEW_STATUS_STYLES as f}from"../styles/ReviewStatusStyles.js";var h=function(e){var t=e.trim().split(/\s+/);return 1===t.length?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()},y=function(e){for(var t=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return t[Math.abs(i)%t.length]},F=function(e){var t=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof t&&t.trim()?t:"No role assigned"};function m(n){var o=n.levels,s=n.reviewData,d=void 0===s?{}:s,a=o.map(function(e,t){var i,n,l,r=null!==(n=null!==(i=d[t])&&void 0!==i?i:d[e.headerName])&&void 0!==n?n:{},o=(null!==(l=e.assignees)&&void 0!==l?l:[]).map(function(e){return{user:e,approved:!0===r[String(e.id)]||!0===r[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===r[String(e.id)]||"rejected"===r[String(e.email)]||"rejected"===e.action}}),s="not_started";if(!0===e.isApproved)s="approved";else if(!0===e.isRejected)s="rejected";else if("approved"===e.status||"completed"===e.status)s="approved";else if("rejected"===e.status)s="rejected";else{var a=o.length>0&&o.every(function(e){return e.approved}),p=o.some(function(e){return e.rejected});a?s="approved":p&&(s="rejected")}return{level:e,assigneeStatuses:o,status:s}}),p=!1,c=a.map(function(t){var i="waiting",n=!0===t.level.isHidden;return"approved"===t.status?i="approved":"rejected"===t.status?(i="rejected",p=!0):t.level.isMandatory||n?p||(i="pending",p=!0):i="optional",e(e({},t),{extendedStatus:i,isFinalApproval:n})}),g=function(e){return e.filter(function(e){return"approved"===e.status}).length}(a),v=a.length;return t("div",e({style:{display:"flex",flexDirection:"column",gap:24}},{children:[t("div",{children:[t("div",e({style:f.progressHeader},{children:[i("span",e({style:f.progressTitle},{children:"Approval Progress"})),t("span",e({style:f.progressCount},{children:[g," of ",v," level",1!==v?"s":""," complete"]}))]})),i("div",e({style:f.progressBarTrack},{children:c.map(function(t,n){var l,r="approved"===t.extendedStatus,o="rejected"===t.extendedStatus,s="optional"===t.extendedStatus,d=0===n,a=n===v-1;return!(null===(l=t.level)||void 0===l?void 0:l.assignees)||!Array.isArray(t.level.assignees)||t.level.assignees.length<1?null:i("div",{style:e(e({},f.progressSegment),{backgroundColor:r?"#6366F1":o?"#EF4444":s?"#F1F5F9":"#E5E7EB",borderRadius:d&&a?"999px":d?"999px 0 0 999px":a?"0 999px 999px 0":"0",marginRight:a?0:3})},n)})})),i("div",e({style:f.progressLabels},{children:c.map(function(t,n){return i("span",e({style:e(e({},f.progressLabel),{color:"approved"===t.extendedStatus?"#6366F1":"rejected"===t.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===t.extendedStatus||"rejected"===t.extendedStatus?600:400})},{children:t.level.assignees&&t.level.assignees.length>0?"".concat(t.level.headerName," - ").concat(t.level.title):""}),n)})}))]}),t("div",e({style:{display:"flex",flexDirection:"column",gap:0}},{children:[i("div",e({style:f.sectionHeadingRow},{children:t("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",e({style:f.sectionTitle},{children:"Approval Levels"})),i(r,{size:15,color:"#9CA3AF"})]}))})),i("div",e({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:c.map(function(n,r){var o,s=r===c.length-1,d=n.isFinalApproval,a=c[r+1],p=null==a?void 0:a.isFinalApproval,g=a&&!a.level.isMandatory&&!p;return t(l.Fragment,d?{children:[t("div",e({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),i("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),i("div",e({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),i(E,{reviewLevel:n})]}:{children:[i(b,{reviewLevel:n}),!s&&!p&&a.level.assignees&&(null===(o=a.level.assignees)||void 0===o?void 0:o.length)>0&&t("div",e({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),i("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:g?"optional":"then"})),i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},r)})}))]})),i(A,{levels:o})]}))}function b(n){var l,a=n.reviewLevel,p=a.level,c=a.assigneeStatuses,g=a.extendedStatus,v=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:i(o,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:i(s,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:i(d,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:i(r,{size:14}),text:"Optional"}}[g])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},u="approved"===g?"1px solid #D1FAE5":"rejected"===g?"1px solid #FCA5A5":"optional"===g?"1px dashed #CBD5E1":"1px solid #E5E7EB",x="approved"===g?"#F0FDF4":"rejected"===g?"#FEF2F2":"#F8FAFC";return!p.assignees||!Array.isArray(p.assignees)||p.assignees.length<1?null:t("div",e({style:{backgroundColor:"#FFFFFF",border:u,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[t("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:x,borderBottom:u,padding:"12px 16px"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[i(z,{name:p.headerName}),i("span",e({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:p.title}))]})),t("div",e({style:{backgroundColor:v.bg,color:v.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[v.icon,v.text]}))]})),i("div",e({style:{padding:"16px"}},{children:c.length>0?i("div",e({style:{display:"flex",flexDirection:"column",gap:16}},{children:c.map(function(e,t){var n;return i(C,{assigneeStatus:e,extendedStatus:g},null!==(n=e.user.id)&&void 0!==n?n:t)})})):i("div",e({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function E(n){var l,a,p,c,g=n.reviewLevel,v=g.assigneeStatuses,u=g.extendedStatus,x=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:i(o,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:i(s,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:i(d,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:i(r,{size:14}),text:"Optional"}}[u])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:i(s,{size:14}),text:"Waiting"},f=null===(a=v[0])||void 0===a?void 0:a.user,m=F(f);return t("div",e({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[f?t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[i("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:y(null!==(p=f.id)&&void 0!==p?p:f.name).bg,color:y(null!==(c=f.id)&&void 0!==c?c:f.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:h(f.name)})),t("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[i("span",e({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:f.name})),t("span",e({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",m]})),i("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):i("span",e({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),t("div",e({style:{backgroundColor:x.bg,color:x.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[x.icon,x.text]}))]}))}function C(l){var r,o=l.assigneeStatus,s=l.extendedStatus,c=o.user,g=o.approved||"approved"===c.action,v=o.rejected||"rejected"===c.action,u=h(c.name),x=y(null!==(r=c.id)&&void 0!==r?r:c.name),f=F(c);return t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[i("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:x.bg,color:x.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:u})),t("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[i("span",e({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:c.name})),i("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:f}))]})),i("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:c.email}))]}))]})),i("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:g?i(a,{size:20,color:"#16A34A",strokeWidth:1.5}):v?i(d,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===s?t(n,{children:[i("span",{style:{fontSize:"13px",color:"#4B5563"}}),i(p,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):i(p,"optional"===s?{size:20,color:"#CBD5E1",strokeWidth:1.5}:{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function z(t){var n=t.name,l=y(n);return i("span",e({style:{backgroundColor:l.bg,color:l.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var S=function(e){switch(e){case 0:return i(x,{size:16,color:"#475569"});case 1:return i(u,{size:16,color:"#475569"});case 2:return i(c,{size:16,color:"#475569"});default:return i(v,{size:16,color:"#475569"})}};function A(n){var r=n.levels.filter(function(e){var t,i;return(null!==(i=null===(t=e.assignees)||void 0===t?void 0:t.length)&&void 0!==i?i:0)>0});return t("div",e({style:f.flowBox},{children:[i("span",e({style:f.flowTitle},{children:"Current Approval Flow"})),r.length>0?i("div",e({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:r.map(function(n,o){var s,d=n.isHidden,a=!n.isMandatory&&!d,p=d?i(c,{size:16,color:"#475569"}):S(o);return t(l.Fragment,{children:[t("span",e({style:e(e({},f.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:a?"1px dashed #CBD5E1":void 0})},{children:[p,t("span",e({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[n.assignees.map(function(n,r){var o,s,d=F(n);return t(l.Fragment,{children:[r>0&&i("span",e({style:{color:"#9CA3AF"}},{children:"/"})),t("span",e({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[i("span",e({style:{fontSize:13,color:a?"#64748B":"#374151"}},{children:n.name})),i("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:d}))]}))]},null!==(s=null!==(o=n.id)&&void 0!==o?o:n.email)&&void 0!==s?s:r)}),a&&i("span",e({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),o<r.length-1&&i(g,{size:16,color:"#9CA3AF"})]},null!==(s=n.id)&&void 0!==s?s:"".concat(n.headerName,"-").concat(o))})})):i("p",e({style:f.flowEmpty},{children:"No owners assigned yet."}))]}))}export{m as default};
2
2
  //# sourceMappingURL=ReviewStatus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyE1B,iBAAS,GAAG,sBAeX;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA0E1B,iBAAS,GAAG,sBAMX;AAED,eAAe,GAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssignReminderLevels.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderLevels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAE,yBAAyB,EAAS,MAAM,eAAe,CAAC;AA0BjE,iBAAS,oBAAoB,CAAC,EAC1B,KAAK,EACL,MAAW,EACX,oBAA4B,EAC5B,cAAc,EACd,SAAS,EACT,uBAAuB,EACvB,UAAU,EACV,kBAAiD,EACjD,cAAc,EACd,iBAAiB,EACjB,YAAiB,EACjB,WAAW,EACX,oBAAoB,GACvB,EAAE,yBAAyB,qBAsQ3B;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"AssignReminderLevels.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderLevels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,EAAE,yBAAyB,EAAS,MAAM,eAAe,CAAC;AA0BjE,iBAAS,oBAAoB,CAAC,EAC1B,KAAK,EACL,MAAW,EACX,oBAA4B,EAC5B,cAAc,EACd,SAAS,EACT,uBAAuB,EACvB,UAAU,EACV,kBAAiD,EACjD,cAAc,EACd,iBAAiB,EACjB,YAAiB,EACjB,WAAW,EACX,oBAAoB,GACvB,EAAE,yBAAyB,qBA6S3B;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viswa-test/creative-workspace-ui-component",
3
- "version": "0.0.58",
3
+ "version": "0.0.59",
4
4
  "author": "Viswa Koduru",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -24,7 +24,7 @@
24
24
  "dist"
25
25
  ],
26
26
  "scripts": {
27
- "start": "craco start",
27
+ "start": "PORT=3007 craco start",
28
28
  "build": "rollup -c && npm run copy:styles",
29
29
  "copy:styles": "mkdir -p dist/features/lsc-guidelines dist/cjs/features/lsc-guidelines && cp src/features/lsc-guidelines/theme.css dist/features/lsc-guidelines/theme.css && cp src/features/lsc-guidelines/theme.css dist/cjs/features/lsc-guidelines/theme.css",
30
30
  "tsupBuild": "tsup src/index.ts",