unifyedx-storybook-new 0.1.41 → 0.1.42

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.
@@ -1351,18 +1351,10 @@
1351
1351
  color: #1c274c;
1352
1352
  }
1353
1353
 
1354
- .text-\[\#6b7280\] {
1355
- color: #6b7280;
1356
- }
1357
-
1358
1354
  .text-\[\#101112\] {
1359
1355
  color: #101112;
1360
1356
  }
1361
1357
 
1362
- .text-\[\#252525\] {
1363
- color: #252525;
1364
- }
1365
-
1366
1358
  .text-\[\#767676\] {
1367
1359
  color: #767676;
1368
1360
  }
@@ -1451,10 +1443,6 @@
1451
1443
  opacity: .7;
1452
1444
  }
1453
1445
 
1454
- .opacity-90 {
1455
- opacity: .9;
1456
- }
1457
-
1458
1446
  .opacity-100 {
1459
1447
  opacity: 1;
1460
1448
  }
@@ -1628,10 +1616,6 @@
1628
1616
  }
1629
1617
  }
1630
1618
 
1631
- .hover\:text-\[\#1f6ed4\]:hover {
1632
- color: #1f6ed4;
1633
- }
1634
-
1635
1619
  .hover\:text-blue-800:hover {
1636
1620
  color: var(--color-blue-800);
1637
1621
  }
@@ -75156,7 +75156,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75156
75156
  }
75157
75157
  }, [section.key, data, updateHandler]);
75158
75158
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { style: { marginBottom: "20px" }, children: [
75159
- /* @__PURE__ */ jsxs(
75159
+ /* @__PURE__ */ jsx(
75160
75160
  "h2",
75161
75161
  {
75162
75162
  style: {
@@ -75164,11 +75164,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75164
75164
  fontWeight: "bold",
75165
75165
  marginBottom: "10px"
75166
75166
  },
75167
- children: [
75168
- section.title,
75169
- " - ",
75170
- section.type
75171
- ]
75167
+ children: section.title
75172
75168
  }
75173
75169
  ),
75174
75170
  /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: section.description }),
@@ -76164,7 +76160,8 @@ function Mt(t){if(typeof document=="undefined")return;let o=document.head||docum
76164
76160
  function DynamicConfig({
76165
76161
  appid,
76166
76162
  configdata = null,
76167
- disableApi = false
76163
+ disableApi = false,
76164
+ onCancel
76168
76165
  }) {
76169
76166
  const [config, setConfig] = React__default.useState(configdata);
76170
76167
  const [data, setData] = React__default.useState(null);
@@ -76487,6 +76484,10 @@ function DynamicConfig({
76487
76484
  saveData();
76488
76485
  };
76489
76486
  const handleCancel = () => {
76487
+ if (onCancel) {
76488
+ onCancel();
76489
+ return;
76490
+ }
76490
76491
  const hasUnsavedChanges = validationErrors && Object.keys(validationErrors).length > 0;
76491
76492
  if (hasUnsavedChanges) {
76492
76493
  const confirmed = window.confirm(
@@ -76562,7 +76563,7 @@ function DynamicConfig({
76562
76563
  ]
76563
76564
  }
76564
76565
  ),
76565
- /* @__PURE__ */ jsxs("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", style: "box-shadow: 0 -2px 10px 0 rgba(0, 0, 0, 0.20); margin-top: 20px;", children: [
76566
+ /* @__PURE__ */ jsxs("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", style: { boxShadow: "0 -2px 10px 0 rgba(0, 0, 0, 0.20)", marginTop: "20px" }, children: [
76566
76567
  /* @__PURE__ */ jsx(
76567
76568
  UnifyedCoreButton,
76568
76569
  {
@@ -76620,6 +76621,7 @@ const FullConfigPage = ({
76620
76621
  disableApi = false
76621
76622
  }) => {
76622
76623
  const [activeTab, setActiveTab] = useState(0);
76624
+ const [showCancelModal, setShowCancelModal] = useState(false);
76623
76625
  const {
76624
76626
  pageHeader = {},
76625
76627
  appletHeader = {},
@@ -76631,8 +76633,22 @@ const FullConfigPage = ({
76631
76633
  heading: "App Details",
76632
76634
  subHeading: "View app details and customize configurations to align with institutional requirements.",
76633
76635
  isLeftArrow: true,
76636
+ onBackClick: () => window.history.back(),
76634
76637
  ...pageHeader
76635
76638
  };
76639
+ const breadcrumbItems = breadcrumb.map((item) => ({
76640
+ label: item.text,
76641
+ href: item.href || "#"
76642
+ }));
76643
+ const handleCancelRequest = () => {
76644
+ setShowCancelModal(true);
76645
+ };
76646
+ const handleCancelConfirm = (result) => {
76647
+ setShowCancelModal(false);
76648
+ if (result.primary) {
76649
+ window.history.back();
76650
+ }
76651
+ };
76636
76652
  const defaultAppletHeader = {
76637
76653
  heading: "Application",
76638
76654
  subHeading: "Application configuration and details",
@@ -76660,7 +76676,7 @@ const FullConfigPage = ({
76660
76676
  };
76661
76677
  const tabs = [
76662
76678
  { label: "Overview", content: renderOverview(defaultOverview) },
76663
- { label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration }, disableApi }) }
76679
+ { label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration }, disableApi, onCancel: handleCancelRequest }) }
76664
76680
  ];
76665
76681
  function renderIcon(icon) {
76666
76682
  if (!icon) {
@@ -76714,25 +76730,16 @@ const FullConfigPage = ({
76714
76730
  ] });
76715
76731
  }
76716
76732
  return /* @__PURE__ */ jsxs("div", { className: "full-config-page", children: [
76717
- /* @__PURE__ */ jsxs("div", { className: "py-3 flex items-center gap-4", children: [
76718
- defaultPageHeader.isLeftArrow && /* @__PURE__ */ jsx(
76719
- "button",
76720
- {
76721
- className: "cursor-pointer flex-shrink-0 mt-1",
76722
- "aria-label": "Go back",
76723
- onClick: () => window.history.back(),
76724
- children: /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M19 12H5M12 19l-7-7 7-7", stroke: "#6b7280", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
76725
- }
76726
- ),
76727
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
76728
- /* @__PURE__ */ jsx("h1", { className: "text-[18px] font-semibold leading-tight truncate m-0", children: defaultPageHeader.heading }),
76729
- /* @__PURE__ */ jsx("p", { className: "text-[13px] font-normal text-[#6b7280] opacity-90 mt-1 truncate mb-0", children: defaultPageHeader.subHeading })
76730
- ] })
76731
- ] }),
76732
- breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("nav", { className: "flex gap-2 items-center text-[13px] text-[#6b7280] mb-4", "aria-label": "Breadcrumb", children: breadcrumb.map((item, index) => /* @__PURE__ */ jsxs("span", { className: "flex items-center", children: [
76733
- index > 0 && /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", style: { margin: "0 2px" }, children: /* @__PURE__ */ jsx("path", { d: "M9 18L15 12L9 6", stroke: "#6b7280", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
76734
- item.isCurrent ? /* @__PURE__ */ jsx("span", { className: "font-semibold text-[#252525]", children: item.text }) : /* @__PURE__ */ jsx("a", { href: item.href, className: "hover:text-[#1f6ed4] cursor-pointer", style: { textDecoration: "none" }, children: item.text })
76735
- ] }, index)) }),
76733
+ /* @__PURE__ */ jsx(
76734
+ PageHeader,
76735
+ {
76736
+ heading: defaultPageHeader.heading,
76737
+ subHeading: breadcrumbItems.length > 0 ? void 0 : defaultPageHeader.subHeading,
76738
+ breadcrumbItems,
76739
+ isLeftArrow: defaultPageHeader.isLeftArrow,
76740
+ onBackClick: defaultPageHeader.onBackClick
76741
+ }
76742
+ ),
76736
76743
  /* @__PURE__ */ jsxs("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
76737
76744
  /* @__PURE__ */ jsx("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: renderIcon(defaultAppletHeader.icon) }),
76738
76745
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
@@ -76759,7 +76766,19 @@ const FullConfigPage = ({
76759
76766
  index
76760
76767
  )) }) }),
76761
76768
  /* @__PURE__ */ jsx("div", { className: "p-8 h-full overflow-y-auto", children: tabs[activeTab].content })
76762
- ] })
76769
+ ] }),
76770
+ /* @__PURE__ */ jsx(
76771
+ Modal,
76772
+ {
76773
+ isOpen: showCancelModal,
76774
+ onClose: handleCancelConfirm,
76775
+ variant: "warning",
76776
+ title: "Are you sure you want to cancel?",
76777
+ primaryButtonText: "Proceed",
76778
+ secondaryButtonText: "Cancel",
76779
+ children: "Your unsaved changes will be lost if you proceed."
76780
+ }
76781
+ )
76763
76782
  ] });
76764
76783
  };
76765
76784