@viswa-test/creative-workspace-ui-component 0.0.64 → 0.0.65

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"),r=require("lucide-react"),t=require("react");exports.default=function(i){var s=i.value,o=i.options,a=i.onChange,l=i.disabled,u=void 0!==l&&l,c=t.useState(!1),d=c[0],p=c[1],x=t.useRef(null),g=o.find(function(e){return e.label===s})||o[0];return t.useEffect(function(){function e(e){x.current&&!x.current.contains(e.target)&&p(!1)}return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]),n.jsxs("div",e.__assign({ref:x,style:{position:"relative",backgroundColor:"#FFFFFF",borderRadius:"5px"}},{children:[n.jsxs("div",e.__assign({onClick:function(){u||p(!d)},style:{display:"flex",alignItems:"center",gap:"6px",cursor:u?"not-allowed":"pointer",background:"transparent",padding:"2px 4px",userSelect:"none",opacity:u?.65:1}},{children:[g.icon&&n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:g.icon})),n.jsx("span",e.__assign({style:{fontSize:"14px"}},{children:g.label})),n.jsx(r.ChevronDown,{size:14,style:{flexShrink:0}})]})),d&&!u&&n.jsx("div",e.__assign({style:{position:"absolute",top:"100%",left:0,marginTop:"4px",background:"white",border:"1px solid #CBD5E1",borderRadius:"6px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",zIndex:50,minWidth:"140px",overflow:"hidden"}},{children:o.map(function(r,t){return n.jsxs("div",e.__assign({onClick:function(){a(r.label),p(!1)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",cursor:"pointer",fontSize:"14px",backgroundColor:s===r.label?"#F1F5F9":"transparent"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#F8FAFC"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor=s===r.label?"#F1F5F9":"transparent"}},{children:[r.icon&&n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:r.icon})),n.jsx("span",{children:r.label})]}),t)})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),r=require("lucide-react"),t=require("react");exports.default=function(i){var s=i.value,o=i.options,l=i.onChange,a=i.disabled,u=void 0!==a&&a,c=t.useState(!1),d=c[0],p=c[1],x=t.useRef(null),g=function(e){return(e||"").trim().toLowerCase().replace(/\s*&\s*/g," and ").replace(/\s+/g," ")},f=o.find(function(e){return g(e.label)===g(s)})||o[0];return t.useEffect(function(){function e(e){x.current&&!x.current.contains(e.target)&&p(!1)}return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]),n.jsxs("div",e.__assign({ref:x,style:{position:"relative",backgroundColor:"#FFFFFF",borderRadius:"5px"}},{children:[n.jsxs("div",e.__assign({onClick:function(){u||p(!d)},style:{display:"flex",alignItems:"center",gap:"6px",cursor:u?"not-allowed":"pointer",background:"transparent",padding:"2px 4px",userSelect:"none",opacity:u?.65:1}},{children:[f.icon&&n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:f.icon})),n.jsx("span",e.__assign({style:{fontSize:"14px"}},{children:f.label})),n.jsx(r.ChevronDown,{size:14,style:{flexShrink:0}})]})),d&&!u&&n.jsx("div",e.__assign({style:{position:"absolute",top:"100%",left:0,marginTop:"4px",background:"white",border:"1px solid #CBD5E1",borderRadius:"6px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",zIndex:50,minWidth:"140px",overflow:"hidden"}},{children:o.map(function(r,t){return n.jsxs("div",e.__assign({onClick:function(){l(r.label),p(!1)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",cursor:"pointer",fontSize:"14px",backgroundColor:(null==f?void 0:f.label)===r.label?"#F1F5F9":"transparent"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#F8FAFC"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor=(null==f?void 0:f.label)===r.label?"#F1F5F9":"transparent"}},{children:[r.icon&&n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:r.icon})),n.jsx("span",{children:r.label})]}),t)})}))]}))};
2
2
  //# sourceMappingURL=CustomDropdown.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("react"),s=require("./CustomDropdown.js"),l=require("./AddUserPopup.js");exports.default=function(r){var t,o,a,d,u,c=this,p=r.assignees,v=r.onAssigneeChange,g=r.accessLevelOptions,_=r.fetchUsers,x=r.wrapperEl,b=r.levelDetails,f=r.displayConfig,h=void 0===f?{}:f,m=i.useState(""),C=m[0],y=m[1],w=i.useState([]),j=w[0],A=w[1],U=i.useState(null),L=U[0],k=U[1];return i.useEffect(function(){if(!h.disableAddUser&&C.trim()){var n=setTimeout(function(){return e.__awaiter(c,void 0,void 0,function(){var n,i,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,_(C)];case 1:return n=e.sent(),i=new Set(p.map(function(e){return e.id})),A(n.filter(function(e){return!i.has(e.id)})),[3,3];case 2:return s=e.sent(),console.error("[LevelData]: fetchUser error:",s),A([]),[3,3];case 3:return[2]}})})},300);return function(){return clearTimeout(n)}}A([])},[C,p]),n.jsxs("div",e.__assign({style:{borderTop:"1px solid #CBD5E1",padding:"20px"}},{children:[n.jsx("span",e.__assign({style:{fontWeight:600,marginBottom:"8px",fontSize:"14px"}},{children:"Assignee Emails"})),n.jsxs("div",e.__assign({style:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"8px",marginTop:"10px",display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},{children:[p.map(function(i){var l,r,t,o=!!i.notes&&"string"==typeof i.notes&&!!i.notes.trim();return n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",background:"#E9D5FF",borderRadius:"10px",padding:"2px 8px",fontSize:"12px"}},{children:[n.jsx("span",e.__assign({style:{padding:"4px"}},{children:i.name})),n.jsx(s.default,{value:null!==(t=null!==(l=i.accessLevel)&&void 0!==l?l:null===(r=g[0])||void 0===r?void 0:r.label)&&void 0!==t?t:"",options:g,onChange:function(n){return s=i.id,l=n,void(h.disableAccessLevelChange||v(p.map(function(n){return n.id===s?e.__assign(e.__assign({},n),{accessLevel:l,role:l}):n})));var s,l},disabled:h.disableAccessLevelChange}),n.jsx("div",e.__assign({style:{position:"relative",display:"inline-flex",backgroundColor:"white",borderRadius:"3px",padding:1}},{children:n.jsx("button",e.__assign({type:"button",disabled:h.disableNotes,onClick:function(){return function(n){h.disableNotes||k(e.__assign({},n))}(i)},style:{border:"none",background:"transparent",cursor:h.disableNotes?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",color:o?"#7C3AED":"#C4B5FD",opacity:h.disableNotes?.6:1}},{children:n.jsx("svg",e.__assign({width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M3.03353 3.90755H5.9502M3.03353 5.94922H7.7002M4.59905 9.44922H8.4002C9.38029 9.44922 9.87033 9.44922 10.2447 9.25848C10.574 9.0907 10.8417 8.82299 11.0095 8.4937C11.2002 8.11936 11.2002 7.62931 11.2002 6.64922V3.49922C11.2002 2.51913 11.2002 2.02908 11.0095 1.65474C10.8417 1.32545 10.574 1.05774 10.2447 0.889957C9.87033 0.699219 9.38029 0.699219 8.4002 0.699219H3.5002C2.5201 0.699219 2.03006 0.699219 1.65571 0.889957C1.32643 1.05774 1.05871 1.32545 0.890934 1.65474C0.700195 2.02908 0.700195 2.51913 0.700195 3.49922V10.8116C0.700195 11.1224 0.700195 11.2778 0.763912 11.3577C0.819325 11.4271 0.903352 11.4675 0.992177 11.4674C1.09431 11.4673 1.21567 11.3702 1.45839 11.176L2.8499 10.0628C3.13416 9.83538 3.27629 9.72167 3.43456 9.64082C3.57498 9.56908 3.72444 9.51665 3.8789 9.48495C4.053 9.44922 4.23502 9.44922 4.59905 9.44922Z",stroke:"#98A2B3","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})}))}))})),n.jsx("button",e.__assign({disabled:h.disableRemoveUser,style:{border:"none",background:"transparent",cursor:h.disableRemoveUser?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",fontSize:"12px",opacity:h.disableRemoveUser?.45:1},onClick:function(){return e=i.id,void(h.disableRemoveUser||(v(p.filter(function(n){return n.id!==e})),(null==L?void 0:L.id)===e&&k(null)));var e},"aria-label":"Remove ".concat(i.name)},{children:"✕"}))]}),i.id)}),n.jsx("input",{type:"text",value:C,placeholder:"Search users...",onChange:function(e){h.disableAddUser||y(e.target.value)},disabled:h.disableAddUser,style:{border:"none",outline:"none",flex:1,minWidth:"150px",fontSize:"12px",cursor:h.disableAddUser?"not-allowed":"text",opacity:h.disableAddUser?.65:1}})]})),j.length>0&&n.jsx("div",e.__assign({style:{border:"1px solid #CBD5E1",borderRadius:"8px",marginTop:"8px"}},{children:j.map(function(i){return n.jsxs("div",e.__assign({style:{padding:"8px",cursor:h.disableAddUser?"not-allowed":"pointer",opacity:h.disableAddUser?.65:1},onClick:function(){return function(n){var i,s,l,r,t,o,a,d;h.disableAddUser||p.some(function(e){return e.id===n.id})||(v(e.__spreadArray(e.__spreadArray([],p,!0),[e.__assign(e.__assign({},n),{accessLevel:null!==(s=null===(i=g[0])||void 0===i?void 0:i.label)&&void 0!==s?s:"",role:null!==(r=null===(l=g[0])||void 0===l?void 0:l.label)&&void 0!==r?r:"",notes:"",sendMailNow:!1})],!1)),y(""),A([]),k(e.__assign(e.__assign({},n),{accessLevel:null!==(o=null===(t=g[0])||void 0===t?void 0:t.label)&&void 0!==o?o:"",role:null!==(d=null===(a=g[0])||void 0===a?void 0:a.label)&&void 0!==d?d:""})))}(i)}},{children:[i.name,i.email&&n.jsx("span",e.__assign({style:{marginLeft:"8px",color:"#6B7280",fontSize:"11px"}},{children:i.email}))]}),i.id)})})),L&&n.jsx(l.AddUserPopup,{user:L,userLevel:{head:null!==(t=null==b?void 0:b.head)&&void 0!==t?t:"",title:null!==(o=null==b?void 0:b.title)&&void 0!==o?o:""},accessLevel:null!==(u=null!==(a=L.accessLevel)&&void 0!==a?a:null===(d=g[0])||void 0===d?void 0:d.label)&&void 0!==u?u:"",wrapperEl:x,onBackToEditing:function(){L&&(v(p.map(function(n){return n.id===L.id?e.__assign(e.__assign({},n),{notes:"",sendMailNow:!1}):n})),k(null))},onSendLater:function(n){h.disableNotes||L&&(v(p.map(function(i){return i.id===L.id?e.__assign(e.__assign({},i),{notes:n,sendMailNow:!1}):i})),k(null))},onSendNow:function(n){h.disableNotes||L&&(v(p.map(function(i){return i.id===L.id?e.__assign(e.__assign({},i),{notes:n,sendMailNow:!0}):i})),k(null))},disabled:h.disableNotes})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),n=require("react/jsx-runtime"),i=require("react"),s=require("./CustomDropdown.js"),r=require("./AddUserPopup.js");exports.default=function(l){var t,a,o,d,u,c=this,p=l.assignees,v=l.onAssigneeChange,g=l.accessLevelOptions,_=l.fetchUsers,x=l.wrapperEl,f=l.levelDetails,b=l.displayConfig,h=void 0===b?{}:b,m=i.useState(""),C=m[0],y=m[1],w=i.useState([]),j=w[0],A=w[1],U=i.useState(null),L=U[0],k=U[1],N=function(e){var n;return e.accessLevel||e.role||""||(null===(n=g[0])||void 0===n?void 0:n.label)||""};return i.useEffect(function(){if(!h.disableAddUser&&C.trim()){var n=setTimeout(function(){return e.__awaiter(c,void 0,void 0,function(){var n,i,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,_(C)];case 1:return n=e.sent(),i=new Set(p.map(function(e){return e.id})),A(n.filter(function(e){return!i.has(e.id)})),[3,3];case 2:return s=e.sent(),console.error("[LevelData]: fetchUser error:",s),A([]),[3,3];case 3:return[2]}})})},300);return function(){return clearTimeout(n)}}A([])},[C,p]),n.jsxs("div",e.__assign({style:{borderTop:"1px solid #CBD5E1",padding:"20px"}},{children:[n.jsx("span",e.__assign({style:{fontWeight:600,marginBottom:"8px",fontSize:"14px"}},{children:"Assignee Emails"})),n.jsxs("div",e.__assign({style:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"8px",marginTop:"10px",display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},{children:[p.map(function(i){var r=!!i.notes&&"string"==typeof i.notes&&!!i.notes.trim();return n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",background:"#E9D5FF",borderRadius:"10px",padding:"2px 8px",fontSize:"12px"}},{children:[n.jsx("span",e.__assign({style:{padding:"4px"}},{children:i.name})),n.jsx(s.default,{value:N(i),options:g,onChange:function(n){return s=i.id,r=n,void(h.disableAccessLevelChange||v(p.map(function(n){return n.id===s?e.__assign(e.__assign({},n),{accessLevel:r,role:r}):n})));var s,r},disabled:h.disableAccessLevelChange}),n.jsx("div",e.__assign({style:{position:"relative",display:"inline-flex",backgroundColor:"white",borderRadius:"3px",padding:1}},{children:n.jsx("button",e.__assign({type:"button",disabled:h.disableNotes,onClick:function(){return function(n){h.disableNotes||k(e.__assign({},n))}(i)},style:{border:"none",background:"transparent",cursor:h.disableNotes?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",color:r?"#7C3AED":"#C4B5FD",opacity:h.disableNotes?.6:1}},{children:n.jsx("svg",e.__assign({width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:n.jsx("path",{d:"M3.03353 3.90755H5.9502M3.03353 5.94922H7.7002M4.59905 9.44922H8.4002C9.38029 9.44922 9.87033 9.44922 10.2447 9.25848C10.574 9.0907 10.8417 8.82299 11.0095 8.4937C11.2002 8.11936 11.2002 7.62931 11.2002 6.64922V3.49922C11.2002 2.51913 11.2002 2.02908 11.0095 1.65474C10.8417 1.32545 10.574 1.05774 10.2447 0.889957C9.87033 0.699219 9.38029 0.699219 8.4002 0.699219H3.5002C2.5201 0.699219 2.03006 0.699219 1.65571 0.889957C1.32643 1.05774 1.05871 1.32545 0.890934 1.65474C0.700195 2.02908 0.700195 2.51913 0.700195 3.49922V10.8116C0.700195 11.1224 0.700195 11.2778 0.763912 11.3577C0.819325 11.4271 0.903352 11.4675 0.992177 11.4674C1.09431 11.4673 1.21567 11.3702 1.45839 11.176L2.8499 10.0628C3.13416 9.83538 3.27629 9.72167 3.43456 9.64082C3.57498 9.56908 3.72444 9.51665 3.8789 9.48495C4.053 9.44922 4.23502 9.44922 4.59905 9.44922Z",stroke:"#98A2B3","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})}))}))})),n.jsx("button",e.__assign({disabled:h.disableRemoveUser,style:{border:"none",background:"transparent",cursor:h.disableRemoveUser?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",fontSize:"12px",opacity:h.disableRemoveUser?.45:1},onClick:function(){return e=i.id,void(h.disableRemoveUser||(v(p.filter(function(n){return n.id!==e})),(null==L?void 0:L.id)===e&&k(null)));var e},"aria-label":"Remove ".concat(i.name)},{children:"✕"}))]}),i.id)}),n.jsx("input",{type:"text",value:C,placeholder:"Search users...",onChange:function(e){h.disableAddUser||y(e.target.value)},disabled:h.disableAddUser,style:{border:"none",outline:"none",flex:1,minWidth:"150px",fontSize:"12px",cursor:h.disableAddUser?"not-allowed":"text",opacity:h.disableAddUser?.65:1}})]})),j.length>0&&n.jsx("div",e.__assign({style:{border:"1px solid #CBD5E1",borderRadius:"8px",marginTop:"8px"}},{children:j.map(function(i){return n.jsxs("div",e.__assign({style:{padding:"8px",cursor:h.disableAddUser?"not-allowed":"pointer",opacity:h.disableAddUser?.65:1},onClick:function(){return function(n){var i,s,r,l,t,a,o,d;h.disableAddUser||p.some(function(e){return e.id===n.id})||(v(e.__spreadArray(e.__spreadArray([],p,!0),[e.__assign(e.__assign({},n),{accessLevel:null!==(s=null===(i=g[0])||void 0===i?void 0:i.label)&&void 0!==s?s:"",role:null!==(l=null===(r=g[0])||void 0===r?void 0:r.label)&&void 0!==l?l:"",notes:"",sendMailNow:!1})],!1)),y(""),A([]),k(e.__assign(e.__assign({},n),{accessLevel:null!==(a=null===(t=g[0])||void 0===t?void 0:t.label)&&void 0!==a?a:"",role:null!==(d=null===(o=g[0])||void 0===o?void 0:o.label)&&void 0!==d?d:""})))}(i)}},{children:[i.name,i.email&&n.jsx("span",e.__assign({style:{marginLeft:"8px",color:"#6B7280",fontSize:"11px"}},{children:i.email}))]}),i.id)})})),L&&n.jsx(r.AddUserPopup,{user:L,userLevel:{head:null!==(t=null==f?void 0:f.head)&&void 0!==t?t:"",title:null!==(a=null==f?void 0:f.title)&&void 0!==a?a:""},accessLevel:null!==(u=null!==(o=L.accessLevel)&&void 0!==o?o:null===(d=g[0])||void 0===d?void 0:d.label)&&void 0!==u?u:"",wrapperEl:x,onBackToEditing:function(){L&&(v(p.map(function(n){return n.id===L.id?e.__assign(e.__assign({},n),{notes:"",sendMailNow:!1}):n})),k(null))},onSendLater:function(n){h.disableNotes||L&&(v(p.map(function(i){return i.id===L.id?e.__assign(e.__assign({},i),{notes:n,sendMailNow:!1}):i})),k(null))},onSendNow:function(n){h.disableNotes||L&&(v(p.map(function(i){return i.id===L.id?e.__assign(e.__assign({},i),{notes:n,sendMailNow:!0}):i})),k(null))},disabled:h.disableNotes})]}))};
2
2
  //# sourceMappingURL=LevelData.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";import{ChevronDown as t}from"lucide-react";import{useState as o,useRef as i,useEffect as l}from"react";function a(a){var d=a.value,c=a.options,s=a.onChange,p=a.disabled,u=void 0!==p&&p,f=o(!1),x=f[0],m=f[1],b=i(null),g=c.find(function(e){return e.label===d})||c[0];return l(function(){function e(e){b.current&&!b.current.contains(e.target)&&m(!1)}return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]),n("div",e({ref:b,style:{position:"relative",backgroundColor:"#FFFFFF",borderRadius:"5px"}},{children:[n("div",e({onClick:function(){u||m(!x)},style:{display:"flex",alignItems:"center",gap:"6px",cursor:u?"not-allowed":"pointer",background:"transparent",padding:"2px 4px",userSelect:"none",opacity:u?.65:1}},{children:[g.icon&&r("span",e({style:{display:"flex",alignItems:"center"}},{children:g.icon})),r("span",e({style:{fontSize:"14px"}},{children:g.label})),r(t,{size:14,style:{flexShrink:0}})]})),x&&!u&&r("div",e({style:{position:"absolute",top:"100%",left:0,marginTop:"4px",background:"white",border:"1px solid #CBD5E1",borderRadius:"6px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",zIndex:50,minWidth:"140px",overflow:"hidden"}},{children:c.map(function(t,o){return n("div",e({onClick:function(){s(t.label),m(!1)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",cursor:"pointer",fontSize:"14px",backgroundColor:d===t.label?"#F1F5F9":"transparent"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#F8FAFC"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor=d===t.label?"#F1F5F9":"transparent"}},{children:[t.icon&&r("span",e({style:{display:"flex",alignItems:"center"}},{children:t.icon})),r("span",{children:t.label})]}),o)})}))]}))}export{a as default};
1
+ import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";import{ChevronDown as t}from"lucide-react";import{useState as o,useRef as i,useEffect as l}from"react";function a(a){var d=a.value,c=a.options,s=a.onChange,u=a.disabled,p=void 0!==u&&u,f=o(!1),x=f[0],b=f[1],g=i(null),m=function(e){return(e||"").trim().toLowerCase().replace(/\s*&\s*/g," and ").replace(/\s+/g," ")},v=c.find(function(e){return m(e.label)===m(d)})||c[0];return l(function(){function e(e){g.current&&!g.current.contains(e.target)&&b(!1)}return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]),n("div",e({ref:g,style:{position:"relative",backgroundColor:"#FFFFFF",borderRadius:"5px"}},{children:[n("div",e({onClick:function(){p||b(!x)},style:{display:"flex",alignItems:"center",gap:"6px",cursor:p?"not-allowed":"pointer",background:"transparent",padding:"2px 4px",userSelect:"none",opacity:p?.65:1}},{children:[v.icon&&r("span",e({style:{display:"flex",alignItems:"center"}},{children:v.icon})),r("span",e({style:{fontSize:"14px"}},{children:v.label})),r(t,{size:14,style:{flexShrink:0}})]})),x&&!p&&r("div",e({style:{position:"absolute",top:"100%",left:0,marginTop:"4px",background:"white",border:"1px solid #CBD5E1",borderRadius:"6px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",zIndex:50,minWidth:"140px",overflow:"hidden"}},{children:c.map(function(t,o){return n("div",e({onClick:function(){s(t.label),b(!1)},style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",cursor:"pointer",fontSize:"14px",backgroundColor:(null==v?void 0:v.label)===t.label?"#F1F5F9":"transparent"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#F8FAFC"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor=(null==v?void 0:v.label)===t.label?"#F1F5F9":"transparent"}},{children:[t.icon&&r("span",e({style:{display:"flex",alignItems:"center"}},{children:t.icon})),r("span",{children:t.label})]}),o)})}))]}))}export{a as default};
2
2
  //# sourceMappingURL=CustomDropdown.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e,__generator as n,__assign as i,__spreadArray as l}from"../../../_virtual/_tslib.js";import{jsxs as o,jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as d}from"react";import s from"./CustomDropdown.js";import{AddUserPopup as a}from"./AddUserPopup.js";function u(u){var c,p,v,f,b,m=this,g=u.assignees,x=u.onAssigneeChange,h=u.accessLevelOptions,C=u.fetchUsers,y=u.wrapperEl,w=u.levelDetails,A=u.displayConfig,U=void 0===A?{}:A,L=t(""),k=L[0],N=L[1],B=t([]),D=B[0],E=B[1],R=t(null),S=R[0],M=R[1];d(function(){if(!U.disableAddUser&&k.trim()){var i=setTimeout(function(){return e(m,void 0,void 0,function(){var e,i,l;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,C(k)];case 1:return e=n.sent(),i=new Set(g.map(function(e){return e.id})),E(e.filter(function(e){return!i.has(e.id)})),[3,3];case 2:return l=n.sent(),console.error("[LevelData]: fetchUser error:",l),E([]),[3,3];case 3:return[2]}})})},300);return function(){return clearTimeout(i)}}E([])},[k,g]);return o("div",i({style:{borderTop:"1px solid #CBD5E1",padding:"20px"}},{children:[r("span",i({style:{fontWeight:600,marginBottom:"8px",fontSize:"14px"}},{children:"Assignee Emails"})),o("div",i({style:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"8px",marginTop:"10px",display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},{children:[g.map(function(e){var n,l,t,d=!!e.notes&&"string"==typeof e.notes&&!!e.notes.trim();return o("div",i({style:{display:"flex",alignItems:"center",gap:"6px",background:"#E9D5FF",borderRadius:"10px",padding:"2px 8px",fontSize:"12px"}},{children:[r("span",i({style:{padding:"4px"}},{children:e.name})),r(s,{value:null!==(t=null!==(n=e.accessLevel)&&void 0!==n?n:null===(l=h[0])||void 0===l?void 0:l.label)&&void 0!==t?t:"",options:h,onChange:function(n){return l=e.id,o=n,void(U.disableAccessLevelChange||x(g.map(function(e){return e.id===l?i(i({},e),{accessLevel:o,role:o}):e})));var l,o},disabled:U.disableAccessLevelChange}),r("div",i({style:{position:"relative",display:"inline-flex",backgroundColor:"white",borderRadius:"3px",padding:1}},{children:r("button",i({type:"button",disabled:U.disableNotes,onClick:function(){return function(e){U.disableNotes||M(i({},e))}(e)},style:{border:"none",background:"transparent",cursor:U.disableNotes?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",color:d?"#7C3AED":"#C4B5FD",opacity:U.disableNotes?.6:1}},{children:r("svg",i({width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M3.03353 3.90755H5.9502M3.03353 5.94922H7.7002M4.59905 9.44922H8.4002C9.38029 9.44922 9.87033 9.44922 10.2447 9.25848C10.574 9.0907 10.8417 8.82299 11.0095 8.4937C11.2002 8.11936 11.2002 7.62931 11.2002 6.64922V3.49922C11.2002 2.51913 11.2002 2.02908 11.0095 1.65474C10.8417 1.32545 10.574 1.05774 10.2447 0.889957C9.87033 0.699219 9.38029 0.699219 8.4002 0.699219H3.5002C2.5201 0.699219 2.03006 0.699219 1.65571 0.889957C1.32643 1.05774 1.05871 1.32545 0.890934 1.65474C0.700195 2.02908 0.700195 2.51913 0.700195 3.49922V10.8116C0.700195 11.1224 0.700195 11.2778 0.763912 11.3577C0.819325 11.4271 0.903352 11.4675 0.992177 11.4674C1.09431 11.4673 1.21567 11.3702 1.45839 11.176L2.8499 10.0628C3.13416 9.83538 3.27629 9.72167 3.43456 9.64082C3.57498 9.56908 3.72444 9.51665 3.8789 9.48495C4.053 9.44922 4.23502 9.44922 4.59905 9.44922Z",stroke:"#98A2B3","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})}))}))})),r("button",i({disabled:U.disableRemoveUser,style:{border:"none",background:"transparent",cursor:U.disableRemoveUser?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",fontSize:"12px",opacity:U.disableRemoveUser?.45:1},onClick:function(){return n=e.id,void(U.disableRemoveUser||(x(g.filter(function(e){return e.id!==n})),(null==S?void 0:S.id)===n&&M(null)));var n},"aria-label":"Remove ".concat(e.name)},{children:"✕"}))]}),e.id)}),r("input",{type:"text",value:k,placeholder:"Search users...",onChange:function(e){U.disableAddUser||N(e.target.value)},disabled:U.disableAddUser,style:{border:"none",outline:"none",flex:1,minWidth:"150px",fontSize:"12px",cursor:U.disableAddUser?"not-allowed":"text",opacity:U.disableAddUser?.65:1}})]})),D.length>0&&r("div",i({style:{border:"1px solid #CBD5E1",borderRadius:"8px",marginTop:"8px"}},{children:D.map(function(e){return o("div",i({style:{padding:"8px",cursor:U.disableAddUser?"not-allowed":"pointer",opacity:U.disableAddUser?.65:1},onClick:function(){return function(e){var n,o,r,t,d,s,a,u;U.disableAddUser||g.some(function(n){return n.id===e.id})||(x(l(l([],g,!0),[i(i({},e),{accessLevel:null!==(o=null===(n=h[0])||void 0===n?void 0:n.label)&&void 0!==o?o:"",role:null!==(t=null===(r=h[0])||void 0===r?void 0:r.label)&&void 0!==t?t:"",notes:"",sendMailNow:!1})],!1)),N(""),E([]),M(i(i({},e),{accessLevel:null!==(s=null===(d=h[0])||void 0===d?void 0:d.label)&&void 0!==s?s:"",role:null!==(u=null===(a=h[0])||void 0===a?void 0:a.label)&&void 0!==u?u:""})))}(e)}},{children:[e.name,e.email&&r("span",i({style:{marginLeft:"8px",color:"#6B7280",fontSize:"11px"}},{children:e.email}))]}),e.id)})})),S&&r(a,{user:S,userLevel:{head:null!==(c=null==w?void 0:w.head)&&void 0!==c?c:"",title:null!==(p=null==w?void 0:w.title)&&void 0!==p?p:""},accessLevel:null!==(b=null!==(v=S.accessLevel)&&void 0!==v?v:null===(f=h[0])||void 0===f?void 0:f.label)&&void 0!==b?b:"",wrapperEl:y,onBackToEditing:function(){S&&(x(g.map(function(e){return e.id===S.id?i(i({},e),{notes:"",sendMailNow:!1}):e})),M(null))},onSendLater:function(e){U.disableNotes||S&&(x(g.map(function(n){return n.id===S.id?i(i({},n),{notes:e,sendMailNow:!1}):n})),M(null))},onSendNow:function(e){U.disableNotes||S&&(x(g.map(function(n){return n.id===S.id?i(i({},n),{notes:e,sendMailNow:!0}):n})),M(null))},disabled:U.disableNotes})]}))}export{u as default};
1
+ import{__awaiter as e,__generator as n,__assign as i,__spreadArray as o}from"../../../_virtual/_tslib.js";import{jsxs as l,jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as d}from"react";import s from"./CustomDropdown.js";import{AddUserPopup as a}from"./AddUserPopup.js";function u(u){var c,p,v,f,b,m=this,g=u.assignees,x=u.onAssigneeChange,h=u.accessLevelOptions,C=u.fetchUsers,y=u.wrapperEl,w=u.levelDetails,A=u.displayConfig,U=void 0===A?{}:A,L=t(""),k=L[0],N=L[1],B=t([]),D=B[0],E=B[1],R=t(null),S=R[0],M=R[1],T=function(e){var n;return e.accessLevel||e.role||""||(null===(n=h[0])||void 0===n?void 0:n.label)||""};d(function(){if(!U.disableAddUser&&k.trim()){var i=setTimeout(function(){return e(m,void 0,void 0,function(){var e,i,o;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,C(k)];case 1:return e=n.sent(),i=new Set(g.map(function(e){return e.id})),E(e.filter(function(e){return!i.has(e.id)})),[3,3];case 2:return o=n.sent(),console.error("[LevelData]: fetchUser error:",o),E([]),[3,3];case 3:return[2]}})})},300);return function(){return clearTimeout(i)}}E([])},[k,g]);return l("div",i({style:{borderTop:"1px solid #CBD5E1",padding:"20px"}},{children:[r("span",i({style:{fontWeight:600,marginBottom:"8px",fontSize:"14px"}},{children:"Assignee Emails"})),l("div",i({style:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"8px",marginTop:"10px",display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},{children:[g.map(function(e){var n=!!e.notes&&"string"==typeof e.notes&&!!e.notes.trim();return l("div",i({style:{display:"flex",alignItems:"center",gap:"6px",background:"#E9D5FF",borderRadius:"10px",padding:"2px 8px",fontSize:"12px"}},{children:[r("span",i({style:{padding:"4px"}},{children:e.name})),r(s,{value:T(e),options:h,onChange:function(n){return o=e.id,l=n,void(U.disableAccessLevelChange||x(g.map(function(e){return e.id===o?i(i({},e),{accessLevel:l,role:l}):e})));var o,l},disabled:U.disableAccessLevelChange}),r("div",i({style:{position:"relative",display:"inline-flex",backgroundColor:"white",borderRadius:"3px",padding:1}},{children:r("button",i({type:"button",disabled:U.disableNotes,onClick:function(){return function(e){U.disableNotes||M(i({},e))}(e)},style:{border:"none",background:"transparent",cursor:U.disableNotes?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",color:n?"#7C3AED":"#C4B5FD",opacity:U.disableNotes?.6:1}},{children:r("svg",i({width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:r("path",{d:"M3.03353 3.90755H5.9502M3.03353 5.94922H7.7002M4.59905 9.44922H8.4002C9.38029 9.44922 9.87033 9.44922 10.2447 9.25848C10.574 9.0907 10.8417 8.82299 11.0095 8.4937C11.2002 8.11936 11.2002 7.62931 11.2002 6.64922V3.49922C11.2002 2.51913 11.2002 2.02908 11.0095 1.65474C10.8417 1.32545 10.574 1.05774 10.2447 0.889957C9.87033 0.699219 9.38029 0.699219 8.4002 0.699219H3.5002C2.5201 0.699219 2.03006 0.699219 1.65571 0.889957C1.32643 1.05774 1.05871 1.32545 0.890934 1.65474C0.700195 2.02908 0.700195 2.51913 0.700195 3.49922V10.8116C0.700195 11.1224 0.700195 11.2778 0.763912 11.3577C0.819325 11.4271 0.903352 11.4675 0.992177 11.4674C1.09431 11.4673 1.21567 11.3702 1.45839 11.176L2.8499 10.0628C3.13416 9.83538 3.27629 9.72167 3.43456 9.64082C3.57498 9.56908 3.72444 9.51665 3.8789 9.48495C4.053 9.44922 4.23502 9.44922 4.59905 9.44922Z",stroke:"#98A2B3","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})}))}))})),r("button",i({disabled:U.disableRemoveUser,style:{border:"none",background:"transparent",cursor:U.disableRemoveUser?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center",fontSize:"12px",opacity:U.disableRemoveUser?.45:1},onClick:function(){return n=e.id,void(U.disableRemoveUser||(x(g.filter(function(e){return e.id!==n})),(null==S?void 0:S.id)===n&&M(null)));var n},"aria-label":"Remove ".concat(e.name)},{children:"✕"}))]}),e.id)}),r("input",{type:"text",value:k,placeholder:"Search users...",onChange:function(e){U.disableAddUser||N(e.target.value)},disabled:U.disableAddUser,style:{border:"none",outline:"none",flex:1,minWidth:"150px",fontSize:"12px",cursor:U.disableAddUser?"not-allowed":"text",opacity:U.disableAddUser?.65:1}})]})),D.length>0&&r("div",i({style:{border:"1px solid #CBD5E1",borderRadius:"8px",marginTop:"8px"}},{children:D.map(function(e){return l("div",i({style:{padding:"8px",cursor:U.disableAddUser?"not-allowed":"pointer",opacity:U.disableAddUser?.65:1},onClick:function(){return function(e){var n,l,r,t,d,s,a,u;U.disableAddUser||g.some(function(n){return n.id===e.id})||(x(o(o([],g,!0),[i(i({},e),{accessLevel:null!==(l=null===(n=h[0])||void 0===n?void 0:n.label)&&void 0!==l?l:"",role:null!==(t=null===(r=h[0])||void 0===r?void 0:r.label)&&void 0!==t?t:"",notes:"",sendMailNow:!1})],!1)),N(""),E([]),M(i(i({},e),{accessLevel:null!==(s=null===(d=h[0])||void 0===d?void 0:d.label)&&void 0!==s?s:"",role:null!==(u=null===(a=h[0])||void 0===a?void 0:a.label)&&void 0!==u?u:""})))}(e)}},{children:[e.name,e.email&&r("span",i({style:{marginLeft:"8px",color:"#6B7280",fontSize:"11px"}},{children:e.email}))]}),e.id)})})),S&&r(a,{user:S,userLevel:{head:null!==(c=null==w?void 0:w.head)&&void 0!==c?c:"",title:null!==(p=null==w?void 0:w.title)&&void 0!==p?p:""},accessLevel:null!==(b=null!==(v=S.accessLevel)&&void 0!==v?v:null===(f=h[0])||void 0===f?void 0:f.label)&&void 0!==b?b:"",wrapperEl:y,onBackToEditing:function(){S&&(x(g.map(function(e){return e.id===S.id?i(i({},e),{notes:"",sendMailNow:!1}):e})),M(null))},onSendLater:function(e){U.disableNotes||S&&(x(g.map(function(n){return n.id===S.id?i(i({},n),{notes:e,sendMailNow:!1}):n})),M(null))},onSendNow:function(e){U.disableNotes||S&&(x(g.map(function(n){return n.id===S.id?i(i({},n),{notes:e,sendMailNow:!0}):n})),M(null))},disabled:U.disableNotes})]}))}export{u as default};
2
2
  //# sourceMappingURL=LevelData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/CustomDropdown.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,iBAAS,cAAc,CAAC,EACpB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAgB,GACnB,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,+BA+FA;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"CustomDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/CustomDropdown.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,iBAAS,cAAc,CAAC,EACpB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAgB,GACnB,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,+BAwGA;AAED,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LevelData.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/LevelData.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAKzD,UAAU,sBAAuB,SAAQ,cAAc;IACnD,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,SAAS,CAAC,EACf,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,YAAY,EACZ,aAAkB,GACrB,EAAE,sBAAsB,+BAgRxB;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"LevelData.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/LevelData.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAKzD,UAAU,sBAAuB,SAAQ,cAAc;IACnD,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,SAAS,CAAC,EACf,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,YAAY,EACZ,aAAkB,GACrB,EAAE,sBAAsB,+BAqRxB;AAED,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viswa-test/creative-workspace-ui-component",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "author": "Viswa Koduru",
5
5
  "description": "",
6
6
  "license": "MIT",