cortex-react-components 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/{chunk-LBPVX5BQ.mjs → chunk-2QYYHKCF.mjs} +1 -1
  2. package/dist/{chunk-BXDKCANT.mjs → chunk-352XMFIA.mjs} +2 -2
  3. package/dist/{chunk-HLEMFDTD.mjs → chunk-3R2LCGLI.mjs} +1 -1
  4. package/dist/{chunk-YOPRYLFQ.mjs → chunk-3VMFZKXK.mjs} +8 -10
  5. package/dist/{chunk-57HPETD7.mjs → chunk-5GC4DBXT.mjs} +4 -4
  6. package/dist/{chunk-PJZ5PWKP.mjs → chunk-5OGDBGXG.mjs} +1 -1
  7. package/dist/{chunk-KIZUBPPQ.mjs → chunk-6GO5N6ZP.mjs} +1 -1
  8. package/dist/{chunk-Z4DNGL7M.mjs → chunk-6X55BFTD.mjs} +1 -1
  9. package/dist/{chunk-MZ5QY6FR.mjs → chunk-A45K7TLD.mjs} +1 -1
  10. package/dist/{chunk-F5IX63U6.mjs → chunk-BCF66L3Y.mjs} +2 -2
  11. package/dist/{chunk-XYLSOGTP.mjs → chunk-FP7MLBPR.mjs} +1 -1
  12. package/dist/{chunk-M62EDEAI.mjs → chunk-FTVOJKVA.mjs} +2 -2
  13. package/dist/{chunk-SJDKHYVC.mjs → chunk-HQE3OP6M.mjs} +10 -10
  14. package/dist/{chunk-CEDQJQTB.mjs → chunk-IAPDQHOE.mjs} +2 -2
  15. package/dist/{chunk-UHF447FN.mjs → chunk-IM6PU3RO.mjs} +8 -5
  16. package/dist/{chunk-QRFYWH62.mjs → chunk-IMWMWTDR.mjs} +1 -1
  17. package/dist/{chunk-RAHAHVM3.mjs → chunk-KAMWFZNX.mjs} +2 -2
  18. package/dist/{chunk-MAQCJ7GT.mjs → chunk-LAJ5FNY4.mjs} +1 -1
  19. package/dist/{chunk-GHJMJFGY.mjs → chunk-NV67QFQM.mjs} +3 -3
  20. package/dist/{chunk-QW6LT3YJ.mjs → chunk-O3CANERK.mjs} +1 -1
  21. package/dist/{chunk-72B7V3AA.mjs → chunk-OQ62XQNJ.mjs} +1 -1
  22. package/dist/{chunk-KHH36D4P.mjs → chunk-OUPOGRNP.mjs} +2 -2
  23. package/dist/{chunk-EGZL4DVZ.mjs → chunk-PAXCURFR.mjs} +1 -1
  24. package/dist/{chunk-FKQJ7IQO.mjs → chunk-PBJRNOV6.mjs} +1 -1
  25. package/dist/{chunk-SZ4XM4DO.mjs → chunk-PSU7NVB6.mjs} +1 -1
  26. package/dist/{chunk-RFZOUE5F.mjs → chunk-QOPCGZNQ.mjs} +1 -1
  27. package/dist/{chunk-4IIO3HGE.mjs → chunk-RYINW7OG.mjs} +1 -1
  28. package/dist/{chunk-FTLBZLKM.mjs → chunk-SGP3VC6H.mjs} +1 -1
  29. package/dist/{chunk-4LGHSMMQ.mjs → chunk-SP6YBXB2.mjs} +1 -1
  30. package/dist/chunk-T7TGES6Z.mjs +25 -0
  31. package/dist/{chunk-EHJIM6JR.mjs → chunk-VNLOFYZP.mjs} +2 -2
  32. package/dist/{chunk-R2LCV7J4.mjs → chunk-VNSEHNDX.mjs} +1 -1
  33. package/dist/{chunk-KN5M6SSZ.mjs → chunk-VTDHFYD3.mjs} +5 -5
  34. package/dist/components/Blocks/Banner.mjs +7 -7
  35. package/dist/components/Blocks/CallToAction.mjs +7 -7
  36. package/dist/components/Blocks/CollapsibleArea.mjs +8 -8
  37. package/dist/components/Blocks/Content.mjs +8 -8
  38. package/dist/components/Blocks/FeaturesBlock.mjs +7 -7
  39. package/dist/components/Blocks/ImageBlock.mjs +3 -3
  40. package/dist/components/Blocks/MediaBlock.mjs +3 -3
  41. package/dist/components/Blocks/RelatedPosts.mjs +9 -9
  42. package/dist/components/Blocks/RenderBlocks.mjs +10 -10
  43. package/dist/components/Blocks/ReusableContentBlock.mjs +10 -10
  44. package/dist/components/Blocks/index.mjs +12 -12
  45. package/dist/components/Cards/ContentCard.mjs +7 -7
  46. package/dist/components/Cards/FeatureCard.mjs +7 -7
  47. package/dist/components/Cards/index.mjs +7 -7
  48. package/dist/components/Chat/ChatInterface.mjs +5 -5
  49. package/dist/components/Chat/CopilotInterface.mjs +6 -6
  50. package/dist/components/Chat/PartTypes/MessageHandler.mjs +4 -4
  51. package/dist/components/Chat/PartTypes/index.mjs +16 -16
  52. package/dist/components/Chat/demo-long-messages.mjs +6 -6
  53. package/dist/components/Chat/demo-tests.mjs +6 -6
  54. package/dist/components/Chat/demo.mjs +6 -6
  55. package/dist/components/Chat/example-usage.mjs +6 -6
  56. package/dist/components/Chat/example-with-vercel-ai.mjs +6 -6
  57. package/dist/components/Chat/index.mjs +6 -6
  58. package/dist/components/DeliveryLead/DeliveryLeadSubmission.js +14 -5
  59. package/dist/components/DeliveryLead/DeliveryLeadSubmission.mjs +2 -1
  60. package/dist/components/DeliveryLead/DeliveryLeadSubmissionList.js +24 -8
  61. package/dist/components/DeliveryLead/DeliveryLeadSubmissionList.mjs +2 -1
  62. package/dist/components/DeliveryLead/DeliveryLeadSubmissionWithList.js +29 -13
  63. package/dist/components/DeliveryLead/DeliveryLeadSubmissionWithList.mjs +4 -3
  64. package/dist/components/DeliveryLead/index.js +37 -17
  65. package/dist/components/DeliveryLead/index.mjs +12 -4
  66. package/dist/components/DeliveryLead/types.d.ts +53 -10
  67. package/dist/components/DeliveryLead/types.js +33 -0
  68. package/dist/components/DeliveryLead/types.mjs +11 -0
  69. package/dist/components/Foundary/Pages/dashboardpage.mjs +2 -2
  70. package/dist/components/Foundary/Views/index.mjs +4 -4
  71. package/dist/components/Foundary/index.mjs +6 -6
  72. package/dist/components/HeaderFooter/SectionHeading.mjs +8 -8
  73. package/dist/components/Heros/HighImpact/index.mjs +8 -8
  74. package/dist/components/Heros/LowImpact/index.mjs +8 -8
  75. package/dist/components/Heros/MediumImpact/index.mjs +8 -8
  76. package/dist/components/Heros/RenderHero.mjs +11 -11
  77. package/dist/components/Heros/index.mjs +13 -13
  78. package/dist/components/Layouts/OutputHeaderFooter.mjs +11 -11
  79. package/dist/components/Layouts/Print.mjs +15 -15
  80. package/dist/components/Layouts/SlideShow.mjs +16 -16
  81. package/dist/components/Layouts/index.mjs +17 -17
  82. package/dist/components/Payload/CollectionArchive/index.mjs +4 -4
  83. package/dist/components/Payload/Media/index.mjs +2 -2
  84. package/dist/components/Payload/PayloadCard/index.mjs +3 -3
  85. package/dist/components/Payload/RichText/index.mjs +7 -7
  86. package/dist/components/Payload/RichText/serialize.mjs +7 -7
  87. package/dist/components/Payload/index.mjs +12 -12
  88. package/dist/components/index.js +37 -15
  89. package/dist/components/index.mjs +51 -43
  90. package/dist/decorators/Intranet.mjs +35 -34
  91. package/dist/index.js +37 -15
  92. package/dist/index.mjs +64 -56
  93. package/dist/metafile-cjs.json +1 -1
  94. package/dist/metafile-esm.json +1 -1
  95. package/dist/pages/Blog.mjs +9 -9
  96. package/dist/pages/IndexPage.mjs +12 -12
  97. package/dist/pages/LandingPage.mjs +45 -44
  98. package/dist/pages/Page.mjs +12 -12
  99. package/dist/pages/Publish.mjs +36 -35
  100. package/dist/pages/Website.mjs +14 -14
  101. package/dist/payload-types.d.ts +1 -1
  102. package/dist/sections/AboutSection.mjs +9 -9
  103. package/dist/sections/BlogDetail.mjs +8 -8
  104. package/dist/sections/BlogList.mjs +9 -9
  105. package/dist/sections/BlogListSection.mjs +1 -1
  106. package/dist/sections/ContactSection.mjs +9 -9
  107. package/dist/sections/PageSections.mjs +45 -44
  108. package/dist/sections/PricingSection.mjs +9 -9
  109. package/dist/sections/ServiceDetail.mjs +8 -8
  110. package/dist/sections/ServiceDetailSection.mjs +8 -8
  111. package/dist/sections/ServiceSection.mjs +36 -35
  112. package/dist/sections/form/index.mjs +2 -2
  113. package/dist/sections/index.mjs +47 -46
  114. package/package.json +1 -1
  115. package/dist/{chunk-57INGMKK.mjs → chunk-ECCJ42NJ.mjs} +7 -7
  116. package/dist/{chunk-OT2SSFKS.mjs → chunk-GSG52WU5.mjs} +3 -3
  117. package/dist/{chunk-2YHN7ZCJ.mjs → chunk-NKRBXAPF.mjs} +3 -3
  118. package/dist/{chunk-NPH4VQCE.mjs → chunk-OUTPT474.mjs} +3 -3
@@ -12,34 +12,34 @@ import {
12
12
  } from "../../chunk-B3GN2ZRO.mjs";
13
13
  import {
14
14
  CopilotInterface
15
- } from "../../chunk-R2LCV7J4.mjs";
15
+ } from "../../chunk-VNSEHNDX.mjs";
16
16
  import "../../chunk-IB4EINFP.mjs";
17
17
  import "../../chunk-3SFZTG3H.mjs";
18
18
  import {
19
19
  ChatInterface
20
- } from "../../chunk-MAQCJ7GT.mjs";
21
- import "../../chunk-57INGMKK.mjs";
20
+ } from "../../chunk-LAJ5FNY4.mjs";
21
+ import "../../chunk-ECCJ42NJ.mjs";
22
+ import "../../chunk-7RGM2O4X.mjs";
23
+ import "../../chunk-HO77MNRT.mjs";
22
24
  import "../../chunk-LY77BPMB.mjs";
23
25
  import "../../chunk-GQGWBOHP.mjs";
24
26
  import "../../chunk-AJ7OZYBW.mjs";
25
27
  import "../../chunk-TWJKNMD2.mjs";
26
28
  import "../../chunk-COGNES33.mjs";
27
- import "../../chunk-7RGM2O4X.mjs";
28
29
  import {
29
30
  ChatCardArtefact
30
31
  } from "../../chunk-G3MFNKC2.mjs";
31
32
  import {
32
33
  ChatCardTask
33
34
  } from "../../chunk-APF7RJ2I.mjs";
34
- import "../../chunk-G3L2ZUUL.mjs";
35
35
  import "../../chunk-FAKMLOOM.mjs";
36
36
  import {
37
37
  OAuthModal
38
38
  } from "../../chunk-5GWDAQL7.mjs";
39
+ import "../../chunk-G3L2ZUUL.mjs";
39
40
  import "../../chunk-3PLZRSCZ.mjs";
40
41
  import "../../chunk-QOUSJBT7.mjs";
41
42
  import "../../chunk-NBOTEZO6.mjs";
42
- import "../../chunk-HO77MNRT.mjs";
43
43
  import {
44
44
  ApprovalRequestModal
45
45
  } from "../../chunk-RUVFSYMR.mjs";
@@ -2560,6 +2560,15 @@ Label.displayName = LabelPrimitive.Root.displayName;
2560
2560
  // src/components/DeliveryLead/DeliveryLeadSubmission.tsx
2561
2561
  var import_lucide_react2 = require("lucide-react");
2562
2562
 
2563
+ // src/components/DeliveryLead/types.ts
2564
+ var RAG_STATUS_OPTIONS = [
2565
+ { label: "Not Started", value: "Not-Started" },
2566
+ { label: "On Track", value: "On-Track" },
2567
+ { label: "Delayed", value: "Delayed" },
2568
+ { label: "At Risk", value: "At Risk" },
2569
+ { label: "Delivered", value: "Delivered" }
2570
+ ];
2571
+
2563
2572
  // src/components/ui/select.tsx
2564
2573
  var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
2565
2574
  var import_lucide_react = require("lucide-react");
@@ -2672,10 +2681,9 @@ var createEmptyMilestone = () => ({
2672
2681
  name: "",
2673
2682
  commentary: "",
2674
2683
  dueDate: "",
2675
- rag: "On-Track",
2684
+ rag: "Not-Started",
2676
2685
  id: null
2677
2686
  });
2678
- var ragOptions = ["On-Track", "Off-Track", "At Risk", "Complete"];
2679
2687
  var formatDateInputValue = (value) => {
2680
2688
  if (!value) return "";
2681
2689
  const parsed = new Date(value);
@@ -2722,7 +2730,7 @@ var buildMilestonesFromPrefill = (prefilled) => {
2722
2730
  name: milestone?.name ?? "",
2723
2731
  commentary: milestone?.commentary ?? "",
2724
2732
  dueDate: formatDateInputValue(milestone?.dueDate ?? ""),
2725
- rag: milestone?.rag ?? "On-Track",
2733
+ rag: milestone?.rag ?? "Not-Started",
2726
2734
  id: milestone?.id ?? null
2727
2735
  }));
2728
2736
  };
@@ -2762,10 +2770,11 @@ function DeliveryLeadSubmissionComponent({ onSubmit, customerProjectPairs, initi
2762
2770
  const prefilledProject = getProjectOption(initialData?.project, getNumericId(initialData?.customer));
2763
2771
  const projectsForCustomer = (customerProjectPairs ?? []).filter((cp) => cp.customer.id === clientId).map((cp) => cp.project);
2764
2772
  const filteredProjects = clientId && prefilledProject && prefilledProject.customerId === clientId && !projectsForCustomer.some((project) => project.id === prefilledProject.id) ? [...projectsForCustomer, { id: prefilledProject.id, name: prefilledProject.name }] : projectsForCustomer;
2773
+ const ragValues = RAG_STATUS_OPTIONS.map((opt) => opt.value);
2765
2774
  const handleMilestoneChange = (idx, field, value) => {
2766
2775
  setMilestones((prev) => {
2767
2776
  const newMilestones = [...prev];
2768
- if (field === "rag" && !ragOptions.includes(value)) {
2777
+ if (field === "rag" && !ragValues.includes(value)) {
2769
2778
  return prev;
2770
2779
  }
2771
2780
  newMilestones[idx] = { ...newMilestones[idx], [field]: value };
@@ -2935,7 +2944,7 @@ function DeliveryLeadSubmissionComponent({ onSubmit, customerProjectPairs, initi
2935
2944
  className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",
2936
2945
  value: m.rag,
2937
2946
  onChange: (e) => handleMilestoneChange(idx, "rag", e.target.value),
2938
- children: ragOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: opt, children: opt }, opt))
2947
+ children: RAG_STATUS_OPTIONS.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
2939
2948
  }
2940
2949
  )
2941
2950
  ] }),
@@ -2,7 +2,8 @@
2
2
  "use strict";
3
3
  import {
4
4
  DeliveryLeadSubmissionComponent
5
- } from "../../chunk-UHF447FN.mjs";
5
+ } from "../../chunk-IM6PU3RO.mjs";
6
+ import "../../chunk-T7TGES6Z.mjs";
6
7
  import "../../chunk-EMGZSA3M.mjs";
7
8
  import "../../chunk-7CVOGGH6.mjs";
8
9
  import "../../chunk-I6LSWXZW.mjs";
@@ -2559,13 +2559,29 @@ Label.displayName = LabelPrimitive.Root.displayName;
2559
2559
 
2560
2560
  // src/components/DeliveryLead/DeliveryLeadSubmissionList.tsx
2561
2561
  var import_lucide_react = require("lucide-react");
2562
- var import_jsx_runtime3 = require("react/jsx-runtime");
2563
- var ragColorMap = {
2562
+
2563
+ // src/components/DeliveryLead/types.ts
2564
+ var RAG_STATUS_OPTIONS = [
2565
+ { label: "Not Started", value: "Not-Started" },
2566
+ { label: "On Track", value: "On-Track" },
2567
+ { label: "Delayed", value: "Delayed" },
2568
+ { label: "At Risk", value: "At Risk" },
2569
+ { label: "Delivered", value: "Delivered" }
2570
+ ];
2571
+ var RAG_COLOR_MAP = {
2572
+ "Not-Started": "bg-gray-100 text-gray-800 border-gray-200",
2564
2573
  "On-Track": "bg-green-100 text-green-800 border-green-200",
2565
- "Off-Track": "bg-red-100 text-red-800 border-red-200",
2574
+ "Delayed": "bg-red-100 text-red-800 border-red-200",
2566
2575
  "At Risk": "bg-yellow-100 text-yellow-800 border-yellow-200",
2567
- Complete: "bg-blue-100 text-blue-800 border-blue-200"
2576
+ "Delivered": "bg-blue-100 text-blue-800 border-blue-200"
2577
+ };
2578
+ var getRagStatusLabel = (value) => {
2579
+ const option = RAG_STATUS_OPTIONS.find((opt) => opt.value === value);
2580
+ return option?.label ?? value;
2568
2581
  };
2582
+
2583
+ // src/components/DeliveryLead/DeliveryLeadSubmissionList.tsx
2584
+ var import_jsx_runtime3 = require("react/jsx-runtime");
2569
2585
  function DeliveryLeadSubmissionList({
2570
2586
  submissions,
2571
2587
  isLoading = false
@@ -2640,8 +2656,8 @@ function DeliveryLeadSubmissionList({
2640
2656
  submission.milestones?.slice(0, 3).map((milestone, idx) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2641
2657
  "span",
2642
2658
  {
2643
- className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${ragColorMap[milestone.rag]}`,
2644
- children: milestone.rag
2659
+ className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${RAG_COLOR_MAP[milestone.rag]}`,
2660
+ children: getRagStatusLabel(milestone.rag)
2645
2661
  },
2646
2662
  idx
2647
2663
  )),
@@ -2745,8 +2761,8 @@ function DeliveryLeadSubmissionList({
2745
2761
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2746
2762
  "span",
2747
2763
  {
2748
- className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${ragColorMap[milestone.rag]}`,
2749
- children: milestone.rag
2764
+ className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${RAG_COLOR_MAP[milestone.rag]}`,
2765
+ children: getRagStatusLabel(milestone.rag)
2750
2766
  }
2751
2767
  ) })
2752
2768
  ] }, idx)) })
@@ -2,7 +2,8 @@
2
2
  "use strict";
3
3
  import {
4
4
  DeliveryLeadSubmissionList
5
- } from "../../chunk-YOPRYLFQ.mjs";
5
+ } from "../../chunk-3VMFZKXK.mjs";
6
+ import "../../chunk-T7TGES6Z.mjs";
6
7
  import "../../chunk-7CVOGGH6.mjs";
7
8
  import "../../chunk-I6LSWXZW.mjs";
8
9
  import "../../chunk-BXLYIIII.mjs";
@@ -2562,13 +2562,29 @@ Label.displayName = LabelPrimitive.Root.displayName;
2562
2562
 
2563
2563
  // src/components/DeliveryLead/DeliveryLeadSubmissionList.tsx
2564
2564
  var import_lucide_react = require("lucide-react");
2565
- var import_jsx_runtime3 = require("react/jsx-runtime");
2566
- var ragColorMap = {
2565
+
2566
+ // src/components/DeliveryLead/types.ts
2567
+ var RAG_STATUS_OPTIONS = [
2568
+ { label: "Not Started", value: "Not-Started" },
2569
+ { label: "On Track", value: "On-Track" },
2570
+ { label: "Delayed", value: "Delayed" },
2571
+ { label: "At Risk", value: "At Risk" },
2572
+ { label: "Delivered", value: "Delivered" }
2573
+ ];
2574
+ var RAG_COLOR_MAP = {
2575
+ "Not-Started": "bg-gray-100 text-gray-800 border-gray-200",
2567
2576
  "On-Track": "bg-green-100 text-green-800 border-green-200",
2568
- "Off-Track": "bg-red-100 text-red-800 border-red-200",
2577
+ "Delayed": "bg-red-100 text-red-800 border-red-200",
2569
2578
  "At Risk": "bg-yellow-100 text-yellow-800 border-yellow-200",
2570
- Complete: "bg-blue-100 text-blue-800 border-blue-200"
2579
+ "Delivered": "bg-blue-100 text-blue-800 border-blue-200"
2580
+ };
2581
+ var getRagStatusLabel = (value) => {
2582
+ const option = RAG_STATUS_OPTIONS.find((opt) => opt.value === value);
2583
+ return option?.label ?? value;
2571
2584
  };
2585
+
2586
+ // src/components/DeliveryLead/DeliveryLeadSubmissionList.tsx
2587
+ var import_jsx_runtime3 = require("react/jsx-runtime");
2572
2588
  function DeliveryLeadSubmissionList({
2573
2589
  submissions,
2574
2590
  isLoading = false
@@ -2643,8 +2659,8 @@ function DeliveryLeadSubmissionList({
2643
2659
  submission.milestones?.slice(0, 3).map((milestone, idx) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2644
2660
  "span",
2645
2661
  {
2646
- className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${ragColorMap[milestone.rag]}`,
2647
- children: milestone.rag
2662
+ className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${RAG_COLOR_MAP[milestone.rag]}`,
2663
+ children: getRagStatusLabel(milestone.rag)
2648
2664
  },
2649
2665
  idx
2650
2666
  )),
@@ -2748,8 +2764,8 @@ function DeliveryLeadSubmissionList({
2748
2764
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2749
2765
  "span",
2750
2766
  {
2751
- className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${ragColorMap[milestone.rag]}`,
2752
- children: milestone.rag
2767
+ className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${RAG_COLOR_MAP[milestone.rag]}`,
2768
+ children: getRagStatusLabel(milestone.rag)
2753
2769
  }
2754
2770
  ) })
2755
2771
  ] }, idx)) })
@@ -2880,10 +2896,9 @@ var createEmptyMilestone = () => ({
2880
2896
  name: "",
2881
2897
  commentary: "",
2882
2898
  dueDate: "",
2883
- rag: "On-Track",
2899
+ rag: "Not-Started",
2884
2900
  id: null
2885
2901
  });
2886
- var ragOptions = ["On-Track", "Off-Track", "At Risk", "Complete"];
2887
2902
  var formatDateInputValue = (value) => {
2888
2903
  if (!value) return "";
2889
2904
  const parsed = new Date(value);
@@ -2930,7 +2945,7 @@ var buildMilestonesFromPrefill = (prefilled) => {
2930
2945
  name: milestone?.name ?? "",
2931
2946
  commentary: milestone?.commentary ?? "",
2932
2947
  dueDate: formatDateInputValue(milestone?.dueDate ?? ""),
2933
- rag: milestone?.rag ?? "On-Track",
2948
+ rag: milestone?.rag ?? "Not-Started",
2934
2949
  id: milestone?.id ?? null
2935
2950
  }));
2936
2951
  };
@@ -2970,10 +2985,11 @@ function DeliveryLeadSubmissionComponent({ onSubmit, customerProjectPairs, initi
2970
2985
  const prefilledProject = getProjectOption(initialData?.project, getNumericId(initialData?.customer));
2971
2986
  const projectsForCustomer = (customerProjectPairs ?? []).filter((cp) => cp.customer.id === clientId).map((cp) => cp.project);
2972
2987
  const filteredProjects = clientId && prefilledProject && prefilledProject.customerId === clientId && !projectsForCustomer.some((project) => project.id === prefilledProject.id) ? [...projectsForCustomer, { id: prefilledProject.id, name: prefilledProject.name }] : projectsForCustomer;
2988
+ const ragValues = RAG_STATUS_OPTIONS.map((opt) => opt.value);
2973
2989
  const handleMilestoneChange = (idx, field, value) => {
2974
2990
  setMilestones((prev) => {
2975
2991
  const newMilestones = [...prev];
2976
- if (field === "rag" && !ragOptions.includes(value)) {
2992
+ if (field === "rag" && !ragValues.includes(value)) {
2977
2993
  return prev;
2978
2994
  }
2979
2995
  newMilestones[idx] = { ...newMilestones[idx], [field]: value };
@@ -3143,7 +3159,7 @@ function DeliveryLeadSubmissionComponent({ onSubmit, customerProjectPairs, initi
3143
3159
  className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",
3144
3160
  value: m.rag,
3145
3161
  onChange: (e) => handleMilestoneChange(idx, "rag", e.target.value),
3146
- children: ragOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: opt, children: opt }, opt))
3162
+ children: RAG_STATUS_OPTIONS.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
3147
3163
  }
3148
3164
  )
3149
3165
  ] }),
@@ -2,9 +2,10 @@
2
2
  "use strict";
3
3
  import {
4
4
  DeliveryLeadSubmissionWithList
5
- } from "../../chunk-M62EDEAI.mjs";
6
- import "../../chunk-YOPRYLFQ.mjs";
7
- import "../../chunk-UHF447FN.mjs";
5
+ } from "../../chunk-FTVOJKVA.mjs";
6
+ import "../../chunk-3VMFZKXK.mjs";
7
+ import "../../chunk-IM6PU3RO.mjs";
8
+ import "../../chunk-T7TGES6Z.mjs";
8
9
  import "../../chunk-EMGZSA3M.mjs";
9
10
  import "../../chunk-7CVOGGH6.mjs";
10
11
  import "../../chunk-I6LSWXZW.mjs";
@@ -35,7 +35,10 @@ var DeliveryLead_exports = {};
35
35
  __export(DeliveryLead_exports, {
36
36
  DeliveryLeadSubmission: () => DeliveryLeadSubmissionComponent,
37
37
  DeliveryLeadSubmissionList: () => DeliveryLeadSubmissionList,
38
- DeliveryLeadSubmissionWithList: () => DeliveryLeadSubmissionWithList
38
+ DeliveryLeadSubmissionWithList: () => DeliveryLeadSubmissionWithList,
39
+ RAG_COLOR_MAP: () => RAG_COLOR_MAP,
40
+ RAG_STATUS_OPTIONS: () => RAG_STATUS_OPTIONS,
41
+ getRagStatusLabel: () => getRagStatusLabel
39
42
  });
40
43
  module.exports = __toCommonJS(DeliveryLead_exports);
41
44
 
@@ -2563,6 +2566,26 @@ Label.displayName = LabelPrimitive.Root.displayName;
2563
2566
  // src/components/DeliveryLead/DeliveryLeadSubmission.tsx
2564
2567
  var import_lucide_react2 = require("lucide-react");
2565
2568
 
2569
+ // src/components/DeliveryLead/types.ts
2570
+ var RAG_STATUS_OPTIONS = [
2571
+ { label: "Not Started", value: "Not-Started" },
2572
+ { label: "On Track", value: "On-Track" },
2573
+ { label: "Delayed", value: "Delayed" },
2574
+ { label: "At Risk", value: "At Risk" },
2575
+ { label: "Delivered", value: "Delivered" }
2576
+ ];
2577
+ var RAG_COLOR_MAP = {
2578
+ "Not-Started": "bg-gray-100 text-gray-800 border-gray-200",
2579
+ "On-Track": "bg-green-100 text-green-800 border-green-200",
2580
+ "Delayed": "bg-red-100 text-red-800 border-red-200",
2581
+ "At Risk": "bg-yellow-100 text-yellow-800 border-yellow-200",
2582
+ "Delivered": "bg-blue-100 text-blue-800 border-blue-200"
2583
+ };
2584
+ var getRagStatusLabel = (value) => {
2585
+ const option = RAG_STATUS_OPTIONS.find((opt) => opt.value === value);
2586
+ return option?.label ?? value;
2587
+ };
2588
+
2566
2589
  // src/components/ui/select.tsx
2567
2590
  var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
2568
2591
  var import_lucide_react = require("lucide-react");
@@ -2675,10 +2698,9 @@ var createEmptyMilestone = () => ({
2675
2698
  name: "",
2676
2699
  commentary: "",
2677
2700
  dueDate: "",
2678
- rag: "On-Track",
2701
+ rag: "Not-Started",
2679
2702
  id: null
2680
2703
  });
2681
- var ragOptions = ["On-Track", "Off-Track", "At Risk", "Complete"];
2682
2704
  var formatDateInputValue = (value) => {
2683
2705
  if (!value) return "";
2684
2706
  const parsed = new Date(value);
@@ -2725,7 +2747,7 @@ var buildMilestonesFromPrefill = (prefilled) => {
2725
2747
  name: milestone?.name ?? "",
2726
2748
  commentary: milestone?.commentary ?? "",
2727
2749
  dueDate: formatDateInputValue(milestone?.dueDate ?? ""),
2728
- rag: milestone?.rag ?? "On-Track",
2750
+ rag: milestone?.rag ?? "Not-Started",
2729
2751
  id: milestone?.id ?? null
2730
2752
  }));
2731
2753
  };
@@ -2765,10 +2787,11 @@ function DeliveryLeadSubmissionComponent({ onSubmit, customerProjectPairs, initi
2765
2787
  const prefilledProject = getProjectOption(initialData?.project, getNumericId(initialData?.customer));
2766
2788
  const projectsForCustomer = (customerProjectPairs ?? []).filter((cp) => cp.customer.id === clientId).map((cp) => cp.project);
2767
2789
  const filteredProjects = clientId && prefilledProject && prefilledProject.customerId === clientId && !projectsForCustomer.some((project) => project.id === prefilledProject.id) ? [...projectsForCustomer, { id: prefilledProject.id, name: prefilledProject.name }] : projectsForCustomer;
2790
+ const ragValues = RAG_STATUS_OPTIONS.map((opt) => opt.value);
2768
2791
  const handleMilestoneChange = (idx, field, value) => {
2769
2792
  setMilestones((prev) => {
2770
2793
  const newMilestones = [...prev];
2771
- if (field === "rag" && !ragOptions.includes(value)) {
2794
+ if (field === "rag" && !ragValues.includes(value)) {
2772
2795
  return prev;
2773
2796
  }
2774
2797
  newMilestones[idx] = { ...newMilestones[idx], [field]: value };
@@ -2938,7 +2961,7 @@ function DeliveryLeadSubmissionComponent({ onSubmit, customerProjectPairs, initi
2938
2961
  className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 p-1 focus:ring-2 focus:ring-accent/40 focus:outline-none",
2939
2962
  value: m.rag,
2940
2963
  onChange: (e) => handleMilestoneChange(idx, "rag", e.target.value),
2941
- children: ragOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: opt, children: opt }, opt))
2964
+ children: RAG_STATUS_OPTIONS.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
2942
2965
  }
2943
2966
  )
2944
2967
  ] }),
@@ -3015,12 +3038,6 @@ function DeliveryLeadSubmissionComponent({ onSubmit, customerProjectPairs, initi
3015
3038
  var import_react2 = require("react");
3016
3039
  var import_lucide_react3 = require("lucide-react");
3017
3040
  var import_jsx_runtime5 = require("react/jsx-runtime");
3018
- var ragColorMap = {
3019
- "On-Track": "bg-green-100 text-green-800 border-green-200",
3020
- "Off-Track": "bg-red-100 text-red-800 border-red-200",
3021
- "At Risk": "bg-yellow-100 text-yellow-800 border-yellow-200",
3022
- Complete: "bg-blue-100 text-blue-800 border-blue-200"
3023
- };
3024
3041
  function DeliveryLeadSubmissionList({
3025
3042
  submissions,
3026
3043
  isLoading = false
@@ -3095,8 +3112,8 @@ function DeliveryLeadSubmissionList({
3095
3112
  submission.milestones?.slice(0, 3).map((milestone, idx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3096
3113
  "span",
3097
3114
  {
3098
- className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${ragColorMap[milestone.rag]}`,
3099
- children: milestone.rag
3115
+ className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${RAG_COLOR_MAP[milestone.rag]}`,
3116
+ children: getRagStatusLabel(milestone.rag)
3100
3117
  },
3101
3118
  idx
3102
3119
  )),
@@ -3200,8 +3217,8 @@ function DeliveryLeadSubmissionList({
3200
3217
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3201
3218
  "span",
3202
3219
  {
3203
- className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${ragColorMap[milestone.rag]}`,
3204
- children: milestone.rag
3220
+ className: `inline-flex items-center px-2 py-1 rounded-full text-xs font-medium border ${RAG_COLOR_MAP[milestone.rag]}`,
3221
+ children: getRagStatusLabel(milestone.rag)
3205
3222
  }
3206
3223
  ) })
3207
3224
  ] }, idx)) })
@@ -3258,5 +3275,8 @@ function DeliveryLeadSubmissionWithList({
3258
3275
  0 && (module.exports = {
3259
3276
  DeliveryLeadSubmission,
3260
3277
  DeliveryLeadSubmissionList,
3261
- DeliveryLeadSubmissionWithList
3278
+ DeliveryLeadSubmissionWithList,
3279
+ RAG_COLOR_MAP,
3280
+ RAG_STATUS_OPTIONS,
3281
+ getRagStatusLabel
3262
3282
  });
@@ -1,12 +1,17 @@
1
1
  import {
2
2
  DeliveryLeadSubmissionWithList
3
- } from "../../chunk-M62EDEAI.mjs";
3
+ } from "../../chunk-FTVOJKVA.mjs";
4
4
  import {
5
5
  DeliveryLeadSubmissionList
6
- } from "../../chunk-YOPRYLFQ.mjs";
6
+ } from "../../chunk-3VMFZKXK.mjs";
7
7
  import {
8
8
  DeliveryLeadSubmissionComponent
9
- } from "../../chunk-UHF447FN.mjs";
9
+ } from "../../chunk-IM6PU3RO.mjs";
10
+ import {
11
+ RAG_COLOR_MAP,
12
+ RAG_STATUS_OPTIONS,
13
+ getRagStatusLabel
14
+ } from "../../chunk-T7TGES6Z.mjs";
10
15
  import "../../chunk-EMGZSA3M.mjs";
11
16
  import "../../chunk-7CVOGGH6.mjs";
12
17
  import "../../chunk-I6LSWXZW.mjs";
@@ -19,5 +24,8 @@ import "../../chunk-6DZX6EAA.mjs";
19
24
  export {
20
25
  DeliveryLeadSubmissionComponent as DeliveryLeadSubmission,
21
26
  DeliveryLeadSubmissionList,
22
- DeliveryLeadSubmissionWithList
27
+ DeliveryLeadSubmissionWithList,
28
+ RAG_COLOR_MAP,
29
+ RAG_STATUS_OPTIONS,
30
+ getRagStatusLabel
23
31
  };
@@ -1,18 +1,61 @@
1
1
  import { DeliveryReport as PayloadDeliveryLeadSubmission } from '../../payload-types';
2
+ /**
3
+ * RAG Status configuration for delivery lead submissions
4
+ * Centralized configuration to ensure consistency across all components
5
+ */
6
+ export declare const RAG_STATUS_OPTIONS: readonly [{
7
+ readonly label: "Not Started";
8
+ readonly value: "Not-Started";
9
+ }, {
10
+ readonly label: "On Track";
11
+ readonly value: "On-Track";
12
+ }, {
13
+ readonly label: "Delayed";
14
+ readonly value: "Delayed";
15
+ }, {
16
+ readonly label: "At Risk";
17
+ readonly value: "At Risk";
18
+ }, {
19
+ readonly label: "Delivered";
20
+ readonly value: "Delivered";
21
+ }];
22
+ export type RagStatus = (typeof RAG_STATUS_OPTIONS)[number]['value'];
23
+ /**
24
+ * Color mapping for RAG status badges
25
+ * Uses Tailwind CSS classes for consistent styling
26
+ */
27
+ export declare const RAG_COLOR_MAP: Record<RagStatus, string>;
28
+ /**
29
+ * Get the display label for a RAG status value
30
+ */
31
+ export declare const getRagStatusLabel: (value: RagStatus) => string;
32
+ export interface Milestone {
33
+ name: string;
34
+ commentary?: string | null;
35
+ dueDate?: string | null;
36
+ rag: RagStatus;
37
+ id?: string | null;
38
+ }
39
+ /**
40
+ * Data structure for submitting delivery lead reports
41
+ * Uses our local Milestone type with new RAG status values
42
+ */
43
+ export interface DeliveryLeadSubmissionData {
44
+ customer: number;
45
+ project: number;
46
+ projectSummary: string;
47
+ milestones?: Milestone[] | null;
48
+ projectUpdate: string;
49
+ projectConcerns?: string | null;
50
+ commercialOpportunities?: string | null;
51
+ commercialRisks?: string | null;
52
+ }
53
+ export type DeliveryLeadSubmissionPrefill = Partial<PayloadDeliveryLeadSubmission>;
2
54
  export interface DeliveryLeadSubmissionProps {
3
- onSubmit?: (formData: Omit<PayloadDeliveryLeadSubmission, 'id' | 'user' | 'updatedAt' | 'createdAt'>) => Promise<{
55
+ onSubmit?: (formData: DeliveryLeadSubmissionData) => Promise<{
4
56
  success: boolean;
5
57
  message: string;
6
58
  }>;
7
59
  isSubmitting?: boolean;
8
60
  initialData?: DeliveryLeadSubmissionPrefill;
9
61
  }
10
- export type DeliveryLeadSubmissionPrefill = Partial<PayloadDeliveryLeadSubmission>;
11
- export type DeliveryLeadSubmissionData = Omit<PayloadDeliveryLeadSubmission, 'id' | 'user' | 'updatedAt' | 'createdAt'>;
12
- export interface Milestone {
13
- name: string;
14
- commentary?: string | null;
15
- dueDate?: string | null;
16
- rag: 'On-Track' | 'Off-Track' | 'At Risk' | 'Complete';
17
- id?: string | null;
18
- }
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -15,4 +19,33 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
15
19
 
16
20
  // src/components/DeliveryLead/types.ts
17
21
  var types_exports = {};
22
+ __export(types_exports, {
23
+ RAG_COLOR_MAP: () => RAG_COLOR_MAP,
24
+ RAG_STATUS_OPTIONS: () => RAG_STATUS_OPTIONS,
25
+ getRagStatusLabel: () => getRagStatusLabel
26
+ });
18
27
  module.exports = __toCommonJS(types_exports);
28
+ var RAG_STATUS_OPTIONS = [
29
+ { label: "Not Started", value: "Not-Started" },
30
+ { label: "On Track", value: "On-Track" },
31
+ { label: "Delayed", value: "Delayed" },
32
+ { label: "At Risk", value: "At Risk" },
33
+ { label: "Delivered", value: "Delivered" }
34
+ ];
35
+ var RAG_COLOR_MAP = {
36
+ "Not-Started": "bg-gray-100 text-gray-800 border-gray-200",
37
+ "On-Track": "bg-green-100 text-green-800 border-green-200",
38
+ "Delayed": "bg-red-100 text-red-800 border-red-200",
39
+ "At Risk": "bg-yellow-100 text-yellow-800 border-yellow-200",
40
+ "Delivered": "bg-blue-100 text-blue-800 border-blue-200"
41
+ };
42
+ var getRagStatusLabel = (value) => {
43
+ const option = RAG_STATUS_OPTIONS.find((opt) => opt.value === value);
44
+ return option?.label ?? value;
45
+ };
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ RAG_COLOR_MAP,
49
+ RAG_STATUS_OPTIONS,
50
+ getRagStatusLabel
51
+ });
@@ -0,0 +1,11 @@
1
+ import {
2
+ RAG_COLOR_MAP,
3
+ RAG_STATUS_OPTIONS,
4
+ getRagStatusLabel
5
+ } from "../../chunk-T7TGES6Z.mjs";
6
+ import "../../chunk-6DZX6EAA.mjs";
7
+ export {
8
+ RAG_COLOR_MAP,
9
+ RAG_STATUS_OPTIONS,
10
+ getRagStatusLabel
11
+ };
@@ -2,11 +2,11 @@
2
2
  "use strict";
3
3
  import {
4
4
  Home
5
- } from "../../../chunk-NPH4VQCE.mjs";
6
- import "../../../chunk-XWCG4YG3.mjs";
5
+ } from "../../../chunk-OUTPT474.mjs";
7
6
  import "../../../chunk-URDEWGQC.mjs";
8
7
  import "../../../chunk-CIFGBEFV.mjs";
9
8
  import "../../../chunk-25EF7VEC.mjs";
9
+ import "../../../chunk-XWCG4YG3.mjs";
10
10
  import "../../../chunk-PR24SSJK.mjs";
11
11
  import "../../../chunk-3W5H36HK.mjs";
12
12
  import "../../../chunk-EJJNYV7C.mjs";
@@ -1,14 +1,14 @@
1
1
  import {
2
- ColleaguesView
3
- } from "../../../chunk-XWCG4YG3.mjs";
2
+ TeamsIndexView
3
+ } from "../../../chunk-A7BJP6MI.mjs";
4
4
  import {
5
5
  KnowledgeView
6
6
  } from "../../../chunk-URDEWGQC.mjs";
7
7
  import "../../../chunk-CIFGBEFV.mjs";
8
8
  import "../../../chunk-25EF7VEC.mjs";
9
9
  import {
10
- TeamsIndexView
11
- } from "../../../chunk-A7BJP6MI.mjs";
10
+ ColleaguesView
11
+ } from "../../../chunk-XWCG4YG3.mjs";
12
12
  import "../../../chunk-PR24SSJK.mjs";
13
13
  import "../../../chunk-4PFDNMLD.mjs";
14
14
  import "../../../chunk-EJJNYV7C.mjs";
@@ -1,17 +1,17 @@
1
1
  import {
2
- Home
3
- } from "../../chunk-NPH4VQCE.mjs";
2
+ TeamsIndexView
3
+ } from "../../chunk-A7BJP6MI.mjs";
4
4
  import {
5
- ColleaguesView
6
- } from "../../chunk-XWCG4YG3.mjs";
5
+ Home
6
+ } from "../../chunk-OUTPT474.mjs";
7
7
  import {
8
8
  KnowledgeView
9
9
  } from "../../chunk-URDEWGQC.mjs";
10
10
  import "../../chunk-CIFGBEFV.mjs";
11
11
  import "../../chunk-25EF7VEC.mjs";
12
12
  import {
13
- TeamsIndexView
14
- } from "../../chunk-A7BJP6MI.mjs";
13
+ ColleaguesView
14
+ } from "../../chunk-XWCG4YG3.mjs";
15
15
  import "../../chunk-PR24SSJK.mjs";
16
16
  import {
17
17
  TeamForm