cortex-react-components 1.42.4 → 1.42.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7XSAYKJ7.mjs → chunk-3PC5BLK7.mjs} +1 -1
- package/dist/{chunk-KRJQF2ZW.mjs → chunk-3ZRLTNWG.mjs} +1 -1
- package/dist/chunk-4NETKTTT.mjs +1 -0
- package/dist/chunk-AHLX3GTH.mjs +1 -0
- package/dist/{chunk-KN2GNSS3.mjs → chunk-CDYA6NPD.mjs} +1 -1
- package/dist/{chunk-IPHHUHS3.mjs → chunk-D43ENVPX.mjs} +1 -1
- package/dist/{chunk-GHBJK554.mjs → chunk-DESYC5BB.mjs} +1 -1
- package/dist/{chunk-IMAQJ7N3.mjs → chunk-EMZQNDA7.mjs} +1 -1
- package/dist/{chunk-TQCGX4Y6.mjs → chunk-ETU7V76A.mjs} +1 -1
- package/dist/{chunk-UA7SFE4H.mjs → chunk-FK53HAB6.mjs} +1 -1
- package/dist/{chunk-VPVXJCL6.mjs → chunk-FO3SKORU.mjs} +1 -1
- package/dist/{chunk-JK3XF6LP.mjs → chunk-GFV75XSU.mjs} +1 -1
- package/dist/{chunk-RZTXT4UD.mjs → chunk-GOMLTG5W.mjs} +1 -1
- package/dist/{chunk-LBKMUSVR.mjs → chunk-IE2A7UT3.mjs} +1 -1
- package/dist/{chunk-SF7DGZCZ.mjs → chunk-LRIIP54N.mjs} +1 -1
- package/dist/{chunk-NLTSDI7A.mjs → chunk-M7Q7FB5A.mjs} +1 -1
- package/dist/{chunk-R57OVXI5.mjs → chunk-OSNRRT4M.mjs} +1 -1
- package/dist/{chunk-J7XKTH35.mjs → chunk-QH3BNFVD.mjs} +1 -1
- package/dist/{chunk-SBHCQ2HK.mjs → chunk-QN26GI2T.mjs} +1 -1
- package/dist/{chunk-KKLZ6CCZ.mjs → chunk-SHN4XZWD.mjs} +1 -1
- package/dist/{chunk-LFBWTXXG.mjs → chunk-UBPXT2KW.mjs} +1 -1
- package/dist/{chunk-L2PQKIU4.mjs → chunk-UDX5Y4SA.mjs} +1 -1
- package/dist/chunk-V4SV2OKK.mjs +4 -0
- package/dist/{chunk-AF5ISZTG.mjs → chunk-VRIZ42XB.mjs} +1 -1
- package/dist/{chunk-JP7FA4RR.mjs → chunk-WDREYBFE.mjs} +1 -1
- package/dist/{chunk-23L5ZJ2U.mjs → chunk-Z4CK655R.mjs} +1 -1
- package/dist/chunk-ZXPDKKGX.mjs +1 -0
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/DealCard.js +1 -1
- package/dist/components/CRM/DealCard.mjs +1 -1
- package/dist/components/CRM/DealCard.stories.js +1 -1
- package/dist/components/CRM/DealCard.stories.mjs +1 -1
- package/dist/components/CRM/DealDetails.js +1 -1
- package/dist/components/CRM/DealDetails.mjs +1 -1
- package/dist/components/CRM/DealDetails.stories.js +1 -1
- package/dist/components/CRM/DealDetails.stories.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.js +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.stories.js +1 -1
- package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.js +1 -1
- package/dist/components/CRM/KanbanColumn.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.stories.js +1 -1
- package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
- package/dist/components/CRM/NewDealForm.js +1 -1
- package/dist/components/CRM/NewDealForm.mjs +1 -1
- package/dist/components/CRM/NewDealForm.stories.js +1 -1
- package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
- package/dist/components/CRM/index.js +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/CRM/mockData.js +1 -1
- package/dist/components/CRM/mockData.mjs +1 -1
- package/dist/components/CRM/types.d.ts +2 -2
- package/dist/components/CRM/types.js +1 -1
- package/dist/components/Cards/ServiceCard.mjs +1 -1
- package/dist/components/Cards/ServiceCard.stories.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/HeaderFooter/Footer.mjs +1 -1
- package/dist/components/HeaderFooter/Footer.stories.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/Header.stories.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.stories.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderMobile.stories.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.stories.mjs +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/BlogList.mjs +1 -1
- package/dist/components/Layouts/BlogList.stories.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.stories.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/SidebarRight.stories.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/index.js +3 -3
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Blog.stories.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/Documentation.stories.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/IndexPage.stories.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/Intranet.stories.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/LandingPage.stories.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Page.stories.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Publish.stories.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/pages/Website.stories.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogDetail.stories.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/BlogListSection.stories.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/ContactSection.stories.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/ServiceSection.stories.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-47TRCRZ7.mjs +0 -1
- package/dist/chunk-QZ2ZSGL6.mjs +0 -4
- package/dist/chunk-RQLWJFYT.mjs +0 -1
- package/dist/chunk-RXJVXPNC.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../chunk-
|
|
1
|
+
import{a as o}from"../chunk-QN26GI2T.mjs";import"../chunk-ETU7V76A.mjs";import"../chunk-SV7NMNDI.mjs";import"../chunk-GLEWUUGS.mjs";import"../chunk-SFLOMJ2U.mjs";import"../chunk-WISCWNL2.mjs";import"../chunk-UESKYRNK.mjs";import"../chunk-NIQ4466A.mjs";import"../chunk-6K2R3OAD.mjs";import"../chunk-S7OK7D5I.mjs";import{FaCog as i}from"react-icons/fa";import{jsx as e}from"react/jsx-runtime";var d={title:"Sections/ServiceSection",component:o,tags:["autodocs"],parameters:{docs:{description:{component:"A card component that displays a service with an icon, title, description, and a link."}}},argTypes:{icon:{control:"text"},title:{control:"text"},description:{control:"text"},slug:{control:"text"}},decorators:[s=>e(s,{})]},t=s=>e(o,{...s}),c=t.bind({});c.args={services:[{icon:e(i,{}),title:"Service Title",description:"This is a description of the service.",slug:"/service"},{icon:{type:"thin",iconName:"image"},title:"Service Title",description:"This is a description of the service.",slug:"/service"},{icon:{type:"kit",iconName:"software"},title:"Service Title",description:"This is a description of the service.",slug:"/service"}]};var r=t.bind({});r.args={services:[]};var n=t.bind({});n.args={services:[{icon:e(i,{}),title:"Service Title",description:"This is a description of the service.",slug:"/service"},{icon:{type:"thin",iconName:"image"},title:"Service Title",description:"This is a description of the service.",slug:"/service"}]};var p=t.bind({});p.args={services:[{icon:e(i,{}),title:"Service Title",description:"This is a description of the service.",slug:"/service"},{icon:{type:"thin",iconName:"image"},title:"Service Title",description:"This is a description of the service.",slug:"/service"},{icon:e(i,{}),title:"Service Title",description:"This is a description of the service.",slug:"/service"},{icon:{type:"thin",iconName:"image"},title:"Service Title",description:"This is a description of the service.",slug:"/service"}]};export{c as Default,r as Empty,p as Four,n as Two,d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../chunk-FO3SKORU.mjs";import"../../chunk-NOEITQK2.mjs";import"../../chunk-EG6XIOOJ.mjs";import"../../chunk-MMBUMBDU.mjs";import"../../chunk-CTKUF2I6.mjs";import"../../chunk-GLEWUUGS.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-6K2R3OAD.mjs";import"../../chunk-S7OK7D5I.mjs";export{a as Form};
|
package/dist/sections/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"../chunk-QN26GI2T.mjs";import{a as d}from"../chunk-SHN4XZWD.mjs";import"../chunk-AD7PG4E2.mjs";import{a as e}from"../chunk-FK53HAB6.mjs";import"../chunk-FO3SKORU.mjs";import"../chunk-NOEITQK2.mjs";import"../chunk-EG6XIOOJ.mjs";import"../chunk-MMBUMBDU.mjs";import"../chunk-CTKUF2I6.mjs";import{a as b}from"../chunk-D3PXELYK.mjs";import"../chunk-ETU7V76A.mjs";import"../chunk-6ZNVXWZR.mjs";import"../chunk-WZLEEZ5C.mjs";import"../chunk-JODGODRI.mjs";import"../chunk-66ZAIUUI.mjs";import"../chunk-SV7NMNDI.mjs";import{a as g}from"../chunk-T6LPMF7A.mjs";import"../chunk-MGZMAVEP.mjs";import{a as c}from"../chunk-AS3NR4OU.mjs";import"../chunk-R7P4VVM3.mjs";import"../chunk-EMZQNDA7.mjs";import"../chunk-IE2A7UT3.mjs";import{a as f}from"../chunk-M7Q7FB5A.mjs";import"../chunk-TXXFXCXB.mjs";import"../chunk-QIGWPB3D.mjs";import"../chunk-O5BAW5XQ.mjs";import"../chunk-NWW7KWJK.mjs";import"../chunk-UK4IPFAO.mjs";import"../chunk-HUN2X4VH.mjs";import"../chunk-ICTOXY7D.mjs";import"../chunk-YNDKGRL6.mjs";import"../chunk-TFWGOEV7.mjs";import"../chunk-763KMQIQ.mjs";import"../chunk-J2VQUYES.mjs";import"../chunk-SJWGFZJ6.mjs";import"../chunk-44TDI42O.mjs";import"../chunk-BOPZHZ27.mjs";import"../chunk-D43ENVPX.mjs";import"../chunk-BSQVKZCW.mjs";import"../chunk-Y5VTKEKS.mjs";import"../chunk-CGBVZQYY.mjs";import"../chunk-YNCJATT7.mjs";import"../chunk-QOIH63J3.mjs";import"../chunk-OAOCXXC2.mjs";import"../chunk-GLEWUUGS.mjs";import"../chunk-D76EO57Z.mjs";import"../chunk-YNNW2C2U.mjs";import"../chunk-SFLOMJ2U.mjs";import"../chunk-WISCWNL2.mjs";import"../chunk-UESKYRNK.mjs";import"../chunk-NIQ4466A.mjs";import"../chunk-6K2R3OAD.mjs";import"../chunk-KML6U7IE.mjs";import"../chunk-FRWX5YES.mjs";import"../chunk-S7OK7D5I.mjs";export{c as AboutSection,f as BlogDetail,d as BlogListSection,e as ContactSection,g as MainPageSection,b as PricingSection,a as ServiceSection};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "cortex-react-components",
|
|
3
3
|
"author": "Cortex Reply",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "1.42.
|
|
5
|
+
"version": "1.42.6",
|
|
6
6
|
"description": "A library of React components with styles. Designed to seamlessly integrate with React and Next.js.",
|
|
7
7
|
"license": "MPL-2.0",
|
|
8
8
|
"main": "./dist/index.js",
|
package/dist/chunk-47TRCRZ7.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as N,c as C,d as f,g as h,i as y}from"./chunk-4JC2TJML.mjs";import{a as x}from"./chunk-4NKKWJ2X.mjs";import{a as H}from"./chunk-A5EYIB3V.mjs";import{a as i}from"./chunk-DWRQHV42.mjs";import{a as M}from"./chunk-Y5ZFXDW5.mjs";import{a as I,f as T,g as E,i as P}from"./chunk-JWDVKGZL.mjs";import{a as c}from"./chunk-QOIH63J3.mjs";import{b as R}from"./chunk-Q6SEVCRG.mjs";import{b as m}from"./chunk-GLEWUUGS.mjs";import{useState as u,useEffect as j}from"react";import{UserIcon as q,CalendarIcon as K,SaveIcon as X,Edit2Icon as Y,PlusIcon as Z}from"lucide-react";import{jsx as a,jsxs as t}from"react/jsx-runtime";function ge({deal:g,users:b,customer:p,categories:S,onClose:O,onSave:U,onAddComment:V}){var L,B,A;let[s,J]=u({...g,value:g.value||0}),[v,D]=u(""),[z,w]=u(!1),[r,l]=u(null);j(()=>{w(JSON.stringify(g)!==JSON.stringify(s))},[g,s]);let G=()=>{U(s),w(!1),l(null)},n=(e,o)=>{J(d=>({...d,[e]:o}))},Q=e=>{let o=s.categories.includes(e)?s.categories.filter(d=>d!==e):[...s.categories,e];n("categories",o)},W=()=>{v.trim()&&(V({id:Date.now().toString(),text:v,timestamp:new Date().toISOString()}),D(""))},k=e=>{switch(e){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},_=(e,o,d)=>{let F=r===e;return t("div",{className:"grid gap-2",children:[a(i,{className:"text-sm font-medium text-gray-500",children:o}),t("div",{className:"flex items-center space-x-2",children:[d,F?a(c,{value:s[e],onChange:$=>n(e,$.target.value),onBlur:()=>l(null),autoFocus:!0}):a("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>l(e),children:s[e]}),!F&&a(m,{variant:"ghost",size:"sm",onClick:()=>l(e),children:a(Y,{className:"w-4 h-4"})})]})]})};return a(I,{open:!0,children:t(T,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[t(E,{className:"flex flex-row items-center justify-between",children:[a(P,{className:"text-2xl font-bold",children:p==null?void 0:p.name}),t("div",{className:"flex space-x-2",children:[a(m,{variant:"outline",onClick:O,children:"Close"}),t(m,{onClick:G,disabled:!z,children:[a(X,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),t(x,{className:"flex-grow pr-4",children:[t("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a("div",{className:"grid gap-2",children:r==="value"?a(c,{type:"number",value:s.value,onChange:e=>n("value",Number(e.target.value)),onBlur:()=>l(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):t("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>l("value"),children:["\xA3",(L=s.value)==null?void 0:L.toLocaleString()]})}),t("div",{className:"grid gap-2",children:[a(i,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),r==="assignee"?t(N,{value:((A=(B=s==null?void 0:s.assignee)==null?void 0:B.id)==null?void 0:A.toString())||"",onValueChange:e=>n("assignee",e),children:[a(f,{children:a(C,{placeholder:"Select assignee"})}),a(h,{children:b&&b.map(e=>{var o;return a(y,{value:((o=e==null?void 0:e.id)==null?void 0:o.toString())||"",children:e.name},e.id)})})]}):t("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>l("assignee"),children:[a(q,{className:"w-4 h-4 text-gray-400"}),a("span",{children:s.assignee.name})]})]}),t("div",{className:"grid gap-2",children:[a(i,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),r==="closureDate"?a(c,{type:"date",value:s.closureDate.split("T")[0],onChange:e=>n("closureDate",e.target.value),onBlur:()=>l(null),autoFocus:!0}):t("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>l("closureDate"),children:[a(K,{className:"w-4 h-4 text-gray-400"}),a("span",{children:new Date(s.closureDate).toLocaleDateString("en-GB")})]})]})]}),a("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:t("div",{className:"grid gap-2",children:[a(i,{className:"text-sm font-medium text-gray-500",children:"Description"}),r==="description"?a(H,{value:s.description,onChange:e=>n("description",e.target.value),onBlur:()=>l(null),className:"min-h-[100px]",autoFocus:!0}):a("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>l("description"),children:s.description})]})}),t("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[t("div",{className:"grid gap-2",children:[a(i,{className:"text-sm font-medium text-gray-500",children:"Status"}),r==="status"?t(N,{value:s.status,onValueChange:e=>{n("status",e),l(null)},children:[a(f,{children:a(C,{placeholder:"Select status"})}),a(h,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(e=>a(y,{value:e,children:e},e))})]}):a("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>l("status"),children:s.status})]}),t("div",{className:"grid col-span-2 gap-2",children:[a(i,{className:"text-sm font-medium text-gray-500",children:"Categories"}),r==="categories"?a("div",{className:"grid grid-cols-2 gap-2",children:S.map(e=>t("div",{className:"flex items-center space-x-2",children:[a(M,{id:e.id,checked:s.categories.includes(e.id),onCheckedChange:()=>Q(e.id)}),a("label",{htmlFor:e.id,className:`text-sm font-medium ${k(e.type)} px-2 py-1 rounded`,children:e.name})]},e.id))}):a("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>l("categories"),children:s.categories.map(e=>{let o=S.find(d=>d.id===e);return o?a(R,{variant:"secondary",className:k(o.type),children:o.name},o.id):null})})]})]}),t("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[t("div",{className:"grid gap-2",children:[a(i,{className:"text-sm font-medium text-gray-500",children:"Comments"}),a(x,{className:"h-[200px] overflow-y-auto",children:a("div",{className:"space-y-2",children:s.comments.map(e=>t("div",{className:"bg-gray-50 p-3 rounded-lg",children:[a("p",{className:"text-sm text-gray-700",children:e.text}),t("p",{className:"text-xs text-gray-500 mt-1",children:[e.author," - ",new Date(e.timestamp).toLocaleString()]})]},e.id))})}),t("div",{className:"flex mt-2",children:[a(c,{value:v,onChange:e=>D(e.target.value),placeholder:"Add a comment...",className:"flex-grow"}),t(m,{onClick:W,className:"ml-2",children:[a(Z,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),t("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(s.lastModified).toLocaleString()]})]})]})]})})}export{ge as a};
|
package/dist/chunk-QZ2ZSGL6.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
import{a as p}from"./chunk-47TRCRZ7.mjs";import{a as D}from"./chunk-SF7DGZCZ.mjs";import{useState as C,useCallback as w}from"react";import{DragDropContext as x}from"react-beautiful-dnd";import{jsx as n,jsxs as N}from"react/jsx-runtime";var B=["Cold","Qualified","Proposal","SoW","Won","Lost"];function V({initialData:r,addNewDeal:g,updateDeal:d,addComment:f,addNewCustomer:v}){let[s,c]=C(null),[a,S]=C(r),R=e=>a.deals.filter(o=>o.status===e),b=e=>e.reduce((o,t)=>o+(t.value||0),0),M=(e,o)=>{let t={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return e.reduce((u,l)=>u+(l.value||0)*t[o],0)},y=w(e=>{let{source:o,destination:t}=e;if(!t||o.droppableId===t.droppableId&&o.index===t.index)return;let u=o.droppableId,l=t.droppableId;console.log("Moving from ",u,"to",l);let i=[...a.deals],[m]=i.splice(o.index,1);m.status=l,i.splice(t.index,0,m),S({...a,deals:i}),d(m)},[a,d]);return n(x,{onDragEnd:y,children:N("div",{className:"p-4",children:[n("div",{className:"flex space-x-4 overflow-x-auto pb-4",children:B.filter(e=>e!=="Won"&&e!=="Lost").map(e=>{let o=R(e);return n(D,{status:e,deals:o,customers:r.customers,users:r.users,categories:r.categories,onDealClick:c,calculateColumnValue:b,calculateWeightedValue:M,addNewDeal:e==="Cold"?g:void 0,onAddCustomer:v},e)})}),s&&n(p,{deal:s,users:r.users,customer:a.customers.find(e=>e.id===s.customer.id),categories:a.categories,onClose:()=>c(null),onSave:d,onAddComment:e=>f(s.id.toString(),e)})]})})}export{V as a};
|
package/dist/chunk-RQLWJFYT.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=[{id:1,name:"Acme Corp",intro:"A leading technology company",active:!0},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1}],t=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}],o=[{id:1,customer:{id:1,name:"Acme Corp",active:!0},value:5e4,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:["1","3","5"],dateLogged:"2023-01-15",closureDate:"2023-06-30",lastModified:"2023-05-01T10:00:00Z",comments:[{id:"1",text:"Initial contact made",author:"John Doe",timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0},value:75e3,assignee:{id:2,name:"Jane Smith"},status:"Proposal",categories:["2","4","6"],dateLogged:"2023-02-01",closureDate:"2023-07-31",lastModified:"2023-05-10T14:30:00Z",comments:[{id:"2",text:"Proposal sent",author:"Jane Smith",timestamp:"2023-05-10T14:30:00Z"}],description:"Custom hardware solution for GlobalTech"}],a=[{id:1,name:"John Doe",email:"john.doe@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Bob Johnson",email:"bob.johnson@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Alice Brown",email:"alice.brown@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Charlie Davis",email:"charlie.davis@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],r={deals:o,users:a,customers:e,categories:t},i=["Cold","Qualified","Proposal","Won","Lost"];export{e as a,t as b,o as c,a as d,r as e,i as f};
|
package/dist/chunk-RXJVXPNC.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as T}from"./chunk-3FW5YDNM.mjs";import{a as g,c as v,d as f,g as C,i as S}from"./chunk-4JC2TJML.mjs";import{a as w}from"./chunk-4NKKWJ2X.mjs";import{a as O}from"./chunk-A5EYIB3V.mjs";import{a as l}from"./chunk-DWRQHV42.mjs";import{a as M}from"./chunk-Y5ZFXDW5.mjs";import{a as A,f as I,g as L,i as P}from"./chunk-JWDVKGZL.mjs";import{a as u}from"./chunk-QOIH63J3.mjs";import{b as p}from"./chunk-GLEWUUGS.mjs";import{useState as h,useEffect as G}from"react";import{PlusIcon as J}from"lucide-react";import{Fragment as K,jsx as t,jsxs as r}from"react/jsx-runtime";function ie({customers:D,users:N,categories:E,onSubmit:R,initialDeal:c,onAddCustomer:V,onClose:n}){var b,y,F,k;let[s,i]=h(c||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",lastModified:new Date().toISOString(),comments:[],description:""}),[q,m]=h(!1),[o,x]=h({});G(()=>{c&&i(c)},[c]);let U=()=>{let e={};return s.customer||(e.customer="Customer is required"),s.value||(e.value="Value is required"),s.assignee||(e.assignee="Assignee is required"),s.closureDate||(e.closureDate="Closure Date is required"),x(e),Object.keys(e).length===0},B=e=>{e.preventDefault(),U()&&(R({...s,lastModified:new Date().toISOString()}),i({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),x({}),n==null||n())},H=e=>{i(a=>{var d;return{...a,categories:(d=a.categories)!=null&&d.includes(e)?a.categories.filter(j=>j!==e):[...a.categories||[],e]}})},z=e=>{D.push(e),i({...s,customer:e}),m(!1),V(e)};return r(K,{children:[r("form",{onSubmit:B,className:"space-y-6",children:[t(w,{className:"h-[60vh] pr-4",children:r("div",{className:"space-y-6 px-4",children:[r("div",{className:"space-y-2 space-x-2",children:[t(l,{htmlFor:"customer",children:"Customer"}),r("div",{className:"flex items-center space-x-2",children:[r(g,{value:(y=(b=s.customer)==null?void 0:b.id)==null?void 0:y.toString(),onValueChange:e=>i({...s,customer:{id:Number(e)}}),children:[t(f,{children:t(v,{placeholder:"Select customer"})}),t(C,{children:D.map(e=>{var a;return t(S,{value:((a=e.id)==null?void 0:a.toString())||"",children:e.name},e.id)})})]}),t(p,{variant:"outline",size:"icon",onClick:()=>m(!0),children:t(J,{className:"w-5 h-5"})})]}),o.customerId&&t("p",{className:"text-red-500 text-sm",children:o.customerId})]}),r("div",{className:"space-y-2 space-x-2",children:[t(l,{htmlFor:"value",children:"Value"}),t(u,{id:"value",type:"number",value:s.value||"",onChange:e=>i({...s,value:Number.parseFloat(e.target.value)}),placeholder:"Enter deal value"}),o.value&&t("p",{className:"text-red-500 text-sm",children:o.value})]}),r("div",{className:"space-y-2 space-x-2",children:[t(l,{htmlFor:"assignee",children:"Assignee"}),r(g,{value:(k=(F=s.assignee)==null?void 0:F.id)==null?void 0:k.toString(),onValueChange:e=>i({...s,assignee:{id:Number(e)}}),children:[t(f,{children:t(v,{placeholder:"Select assignee"})}),t(C,{children:N&&N.map(e=>{var a;return t(S,{value:((a=e.id)==null?void 0:a.toString())||"",children:e.name},e.id)})})]}),o.assignee&&t("p",{className:"text-red-500 text-sm",children:o.assignee})]}),r("div",{className:"space-y-2 space-x-2",children:[t(l,{htmlFor:"description",children:"Description"}),t(O,{id:"description",value:s.description||"",onChange:e=>i({...s,description:e.target.value}),placeholder:"Enter deal description"})]}),r("div",{className:"space-y-2 space-x-2",children:[t(l,{children:"Categories"}),t("div",{className:"space-y-4",children:["proposition","source","sector"].map(e=>r("div",{className:"space-y-2",children:[t("h4",{className:"text-sm font-medium",children:e.charAt(0).toUpperCase()+e.slice(1)}),t("div",{className:"grid grid-cols-2 gap-2",children:E.filter(a=>a.type===e).map(a=>{var d;return r("div",{className:"flex items-center space-x-2",children:[t(M,{id:a.id,checked:(d=s.categories)==null?void 0:d.includes(a.id),onCheckedChange:()=>H(a.id)}),t("label",{htmlFor:a.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:a.name})]},a.id)})})]},e))})]}),r("div",{className:"space-y-2 space-x-2",children:[t(l,{htmlFor:"closureDate",children:"Closure Date"}),t(u,{id:"closureDate",type:"date",value:s.closureDate,onChange:e=>i({...s,closureDate:e.target.value})}),o.closureDate&&t("p",{className:"text-red-500 text-sm",children:o.closureDate})]})]})}),t(p,{type:"submit",className:"w-full",children:c?"Update Deal":"Add Deal"})]}),t(A,{open:q,onOpenChange:m,children:r(I,{children:[t(L,{children:t(P,{children:"Add New Customer"})}),t(T,{onSubmit:z})]})})]})}export{ie as a};
|