unifyedx-storybook-new 0.1.40 → 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.
@@ -72,7 +72,6 @@
72
72
  --color-teal-700: oklch(51.1% .096 186.391);
73
73
  --color-blue-50: oklch(97% .014 254.604);
74
74
  --color-blue-100: oklch(93.2% .032 255.585);
75
- --color-blue-200: oklch(88.2% .059 254.128);
76
75
  --color-blue-300: oklch(80.9% .105 251.813);
77
76
  --color-blue-400: oklch(70.7% .165 254.624);
78
77
  --color-blue-500: oklch(62.3% .214 259.815);
@@ -80,8 +79,6 @@
80
79
  --color-blue-700: oklch(48.8% .243 264.376);
81
80
  --color-blue-800: oklch(42.4% .199 265.638);
82
81
  --color-blue-900: oklch(37.9% .146 265.522);
83
- --color-indigo-600: oklch(51.1% .262 276.966);
84
- --color-indigo-800: oklch(39.8% .195 277.366);
85
82
  --color-purple-500: oklch(62.7% .265 303.9);
86
83
  --color-gray-50: oklch(98.5% .002 247.839);
87
84
  --color-gray-100: oklch(96.7% .003 264.542);
@@ -567,10 +564,6 @@
567
564
  margin-left: calc(var(--spacing) * -4);
568
565
  }
569
566
 
570
- .ml-2 {
571
- margin-left: calc(var(--spacing) * 2);
572
- }
573
-
574
567
  .block {
575
568
  display: block;
576
569
  }
@@ -1040,10 +1033,6 @@
1040
1033
  border-color: var(--color-black);
1041
1034
  }
1042
1035
 
1043
- .border-blue-200 {
1044
- border-color: var(--color-blue-200);
1045
- }
1046
-
1047
1036
  .border-gray-200 {
1048
1037
  border-color: var(--color-gray-200);
1049
1038
  }
@@ -1086,10 +1075,6 @@
1086
1075
  background-color: #fff;
1087
1076
  }
1088
1077
 
1089
- .bg-black {
1090
- background-color: var(--color-black);
1091
- }
1092
-
1093
1078
  .bg-black\/30 {
1094
1079
  background-color: #0000004d;
1095
1080
  }
@@ -1100,10 +1085,6 @@
1100
1085
  }
1101
1086
  }
1102
1087
 
1103
- .bg-blue-50 {
1104
- background-color: var(--color-blue-50);
1105
- }
1106
-
1107
1088
  .bg-blue-100 {
1108
1089
  background-color: var(--color-blue-100);
1109
1090
  }
@@ -1313,6 +1294,10 @@
1313
1294
  font-size: 18px;
1314
1295
  }
1315
1296
 
1297
+ .text-\[24px\] {
1298
+ font-size: 24px;
1299
+ }
1300
+
1316
1301
  .leading-5 {
1317
1302
  --tw-leading: calc(var(--spacing) * 5);
1318
1303
  line-height: calc(var(--spacing) * 5);
@@ -1366,12 +1351,8 @@
1366
1351
  color: #1c274c;
1367
1352
  }
1368
1353
 
1369
- .text-\[\#6b7280\] {
1370
- color: #6b7280;
1371
- }
1372
-
1373
- .text-\[\#252525\] {
1374
- color: #252525;
1354
+ .text-\[\#101112\] {
1355
+ color: #101112;
1375
1356
  }
1376
1357
 
1377
1358
  .text-\[\#767676\] {
@@ -1426,10 +1407,6 @@
1426
1407
  color: var(--color-green-500);
1427
1408
  }
1428
1409
 
1429
- .text-indigo-600 {
1430
- color: var(--color-indigo-600);
1431
- }
1432
-
1433
1410
  .text-purple-500 {
1434
1411
  color: var(--color-purple-500);
1435
1412
  }
@@ -1466,10 +1443,6 @@
1466
1443
  opacity: .7;
1467
1444
  }
1468
1445
 
1469
- .opacity-90 {
1470
- opacity: .9;
1471
- }
1472
-
1473
1446
  .opacity-100 {
1474
1447
  opacity: 1;
1475
1448
  }
@@ -1643,10 +1616,6 @@
1643
1616
  }
1644
1617
  }
1645
1618
 
1646
- .hover\:text-\[\#1f6ed4\]:hover {
1647
- color: #1f6ed4;
1648
- }
1649
-
1650
1619
  .hover\:text-blue-800:hover {
1651
1620
  color: var(--color-blue-800);
1652
1621
  }
@@ -1667,10 +1636,6 @@
1667
1636
  color: var(--color-gray-900);
1668
1637
  }
1669
1638
 
1670
- .hover\:text-indigo-800:hover {
1671
- color: var(--color-indigo-800);
1672
- }
1673
-
1674
1639
  .hover\:text-red-500:hover {
1675
1640
  color: var(--color-red-500);
1676
1641
  }
@@ -4517,7 +4482,6 @@ body {
4517
4482
  z-index: 0;
4518
4483
  box-sizing: border-box;
4519
4484
  width: 100%;
4520
- padding: 1.25rem;
4521
4485
  position: relative;
4522
4486
  }
4523
4487
 
@@ -8559,7 +8523,6 @@ body.toast-backdrop #ui-toast-backdrop {
8559
8523
  .page-layout {
8560
8524
  position: relative;
8561
8525
  width: 100%;
8562
- padding: 1.25rem; /* py-5 */
8563
8526
  z-index: 0;
8564
8527
  box-sizing: border-box;
8565
8528
  }
@@ -9967,7 +9930,6 @@ body.toast-backdrop #ui-toast-backdrop {
9967
9930
  }
9968
9931
  /* FullConfigPage Styles */
9969
9932
  .full-config-page {
9970
- margin: 28px auto;
9971
9933
  padding: 18px;
9972
9934
  background: #f5f6f8;
9973
9935
  min-height: 100vh;
@@ -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 }),
@@ -75205,6 +75201,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75205
75201
  }
75206
75202
  },
75207
75203
  required: field.required,
75204
+ disabled: field.disabled ? field.disabled : false,
75208
75205
  className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
75209
75206
  }
75210
75207
  ),
@@ -75227,6 +75224,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75227
75224
  },
75228
75225
  rows: 3,
75229
75226
  required: field.required,
75227
+ disabled: field.disabled ? field.disabled : false,
75230
75228
  className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
75231
75229
  }
75232
75230
  ),
@@ -75249,6 +75247,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75249
75247
  }
75250
75248
  },
75251
75249
  required: field.required,
75250
+ disabled: field.disabled ? field.disabled : false,
75252
75251
  className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
75253
75252
  }
75254
75253
  ),
@@ -75268,6 +75267,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75268
75267
  }
75269
75268
  },
75270
75269
  label: field.placeholder || field.label,
75270
+ disabled: field.disabled ? field.disabled : false,
75271
75271
  className: "w-full"
75272
75272
  }
75273
75273
  ),
@@ -75290,6 +75290,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75290
75290
  options: field.options || [],
75291
75291
  placeholder: field.placeholder || `Select ${field.label}`,
75292
75292
  required: field.required,
75293
+ disabled: field.disabled ? field.disabled : false,
75293
75294
  className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
75294
75295
  }
75295
75296
  ),
@@ -75312,6 +75313,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75312
75313
  }
75313
75314
  },
75314
75315
  required: field.required,
75316
+ disabled: field.disabled ? field.disabled : false,
75315
75317
  className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
75316
75318
  }
75317
75319
  ),
@@ -75334,6 +75336,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75334
75336
  }
75335
75337
  },
75336
75338
  required: field.required,
75339
+ disabled: field.disabled ? field.disabled : false,
75337
75340
  className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
75338
75341
  }
75339
75342
  ),
@@ -75356,6 +75359,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75356
75359
  }
75357
75360
  },
75358
75361
  required: field.required,
75362
+ disabled: field.disabled ? field.disabled : false,
75359
75363
  className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
75360
75364
  }
75361
75365
  ),
@@ -75375,6 +75379,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75375
75379
  },
75376
75380
  options: field.options || [],
75377
75381
  placeholder: field.placeholder || `Select ${field.label}`,
75382
+ disabled: field.disabled ? field.disabled : false,
75378
75383
  className: `w-full ${validationErrors[section.key]?.[field.key] ? "border-red-500" : ""}`
75379
75384
  }
75380
75385
  ),
@@ -75393,7 +75398,8 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75393
75398
  updateHandler(section.key, newData);
75394
75399
  }
75395
75400
  },
75396
- label: field.placeholder || field.label
75401
+ label: field.placeholder || field.label,
75402
+ disabled: field.disabled ? field.disabled : false
75397
75403
  }
75398
75404
  ),
75399
75405
  validationErrors[section.key]?.[field.key] && /* @__PURE__ */ jsx("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: validationErrors[section.key][field.key] })
@@ -75411,6 +75417,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75411
75417
  }
75412
75418
  },
75413
75419
  placeholder: field.placeholder || "Select date",
75420
+ disabled: field.disabled ? field.disabled : false,
75414
75421
  error: validationErrors[section.key]?.[field.key],
75415
75422
  className: "w-full"
75416
75423
  }
@@ -75428,6 +75435,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75428
75435
  }
75429
75436
  },
75430
75437
  placeholder: field.placeholder || "Select date range",
75438
+ disabled: field.disabled ? field.disabled : false,
75431
75439
  error: validationErrors[section.key]?.[field.key],
75432
75440
  className: "w-full"
75433
75441
  }
@@ -75445,6 +75453,7 @@ function SectionRenderer({ item, data: initialData, updateHandler, validationErr
75445
75453
  }
75446
75454
  },
75447
75455
  options: field.options || [],
75456
+ disabled: field.disabled ? field.disabled : false,
75448
75457
  className: "w-full"
75449
75458
  }
75450
75459
  ),
@@ -75877,7 +75886,7 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
75877
75886
  /* @__PURE__ */ jsx(
75878
75887
  "button",
75879
75888
  {
75880
- className: "text-indigo-600 font-semibold hover:text-indigo-800",
75889
+ className: "text-blue-600 font-semibold hover:text-blue-800",
75881
75890
  onClick: () => {
75882
75891
  setAudienceFieldName(field.key);
75883
75892
  setAudienceRowId(rowIndex);
@@ -76036,7 +76045,7 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
76036
76045
  /* @__PURE__ */ jsx(
76037
76046
  "button",
76038
76047
  {
76039
- className: "bg-black text-white px-6 py-2 rounded-2xl cursor-pointer hover:bg-gray-800",
76048
+ className: "btn btn-primary text-white px-6 py-2 rounded-2xl cursor-pointer hover:bg-gray-800",
76040
76049
  onClick: addBlankRow,
76041
76050
  children: "Add"
76042
76051
  }
@@ -76151,7 +76160,8 @@ function Mt(t){if(typeof document=="undefined")return;let o=document.head||docum
76151
76160
  function DynamicConfig({
76152
76161
  appid,
76153
76162
  configdata = null,
76154
- disableApi = false
76163
+ disableApi = false,
76164
+ onCancel
76155
76165
  }) {
76156
76166
  const [config, setConfig] = React__default.useState(configdata);
76157
76167
  const [data, setData] = React__default.useState(null);
@@ -76474,6 +76484,10 @@ function DynamicConfig({
76474
76484
  saveData();
76475
76485
  };
76476
76486
  const handleCancel = () => {
76487
+ if (onCancel) {
76488
+ onCancel();
76489
+ return;
76490
+ }
76477
76491
  const hasUnsavedChanges = validationErrors && Object.keys(validationErrors).length > 0;
76478
76492
  if (hasUnsavedChanges) {
76479
76493
  const confirmed = window.confirm(
@@ -76527,13 +76541,10 @@ function DynamicConfig({
76527
76541
  /* @__PURE__ */ jsxs(
76528
76542
  "div",
76529
76543
  {
76530
- className: "dynamic-config bg-white border rounded-t-2xl border-gray-300 w-full h-[calc(100vh-350px)] overflow-y-auto",
76531
- style: { padding: "20px", fontFamily: "Arial, sans-serif" },
76544
+ className: "dynamic-config bg-white w-full h-[calc(100vh-350px)] overflow-y-auto",
76545
+ style: { padding: "0px 20px 0px 0px" },
76532
76546
  children: [
76533
- loading && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center mb-4 p-4 bg-blue-50 border border-blue-200 rounded", children: [
76534
- /* @__PURE__ */ jsx(Spinner, { size: "small" }),
76535
- /* @__PURE__ */ jsx("span", { className: "ml-2 text-blue-700", children: "Loading configuration..." })
76536
- ] }),
76547
+ loading && /* @__PURE__ */ jsx(Spinner, { size: "small" }),
76537
76548
  configurationSections?.map((section, index) => {
76538
76549
  const C = getComponentForType(section.type);
76539
76550
  if (C && C !== "UnknownType") {
@@ -76552,7 +76563,7 @@ function DynamicConfig({
76552
76563
  ]
76553
76564
  }
76554
76565
  ),
76555
- /* @__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", 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: [
76556
76567
  /* @__PURE__ */ jsx(
76557
76568
  UnifyedCoreButton,
76558
76569
  {
@@ -76610,6 +76621,7 @@ const FullConfigPage = ({
76610
76621
  disableApi = false
76611
76622
  }) => {
76612
76623
  const [activeTab, setActiveTab] = useState(0);
76624
+ const [showCancelModal, setShowCancelModal] = useState(false);
76613
76625
  const {
76614
76626
  pageHeader = {},
76615
76627
  appletHeader = {},
@@ -76621,8 +76633,22 @@ const FullConfigPage = ({
76621
76633
  heading: "App Details",
76622
76634
  subHeading: "View app details and customize configurations to align with institutional requirements.",
76623
76635
  isLeftArrow: true,
76636
+ onBackClick: () => window.history.back(),
76624
76637
  ...pageHeader
76625
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
+ };
76626
76652
  const defaultAppletHeader = {
76627
76653
  heading: "Application",
76628
76654
  subHeading: "Application configuration and details",
@@ -76650,7 +76676,7 @@ const FullConfigPage = ({
76650
76676
  };
76651
76677
  const tabs = [
76652
76678
  { label: "Overview", content: renderOverview(defaultOverview) },
76653
- { label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration }, disableApi }) }
76679
+ { label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration }, disableApi, onCancel: handleCancelRequest }) }
76654
76680
  ];
76655
76681
  function renderIcon(icon) {
76656
76682
  if (!icon) {
@@ -76704,30 +76730,21 @@ const FullConfigPage = ({
76704
76730
  ] });
76705
76731
  }
76706
76732
  return /* @__PURE__ */ jsxs("div", { className: "full-config-page", children: [
76707
- /* @__PURE__ */ jsxs("div", { className: "py-3 flex items-center gap-4", children: [
76708
- defaultPageHeader.isLeftArrow && /* @__PURE__ */ jsx(
76709
- "button",
76710
- {
76711
- className: "cursor-pointer flex-shrink-0 mt-1",
76712
- "aria-label": "Go back",
76713
- onClick: () => window.history.back(),
76714
- 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" }) })
76715
- }
76716
- ),
76717
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
76718
- /* @__PURE__ */ jsx("h1", { className: "text-[18px] font-semibold leading-tight truncate m-0", children: defaultPageHeader.heading }),
76719
- /* @__PURE__ */ jsx("p", { className: "text-[13px] font-normal text-[#6b7280] opacity-90 mt-1 truncate mb-0", children: defaultPageHeader.subHeading })
76720
- ] })
76721
- ] }),
76722
- 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: [
76723
- 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" }) }),
76724
- 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 })
76725
- ] }, 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
+ ),
76726
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: [
76727
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) }),
76728
76745
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
76729
- /* @__PURE__ */ jsx("h2", { className: "text-[18px] font-semibold m-0 leading-tight truncate", children: defaultAppletHeader.heading }),
76730
- /* @__PURE__ */ jsx("p", { className: "text-[13px] text-[#767676] mt-1 mb-0 max-w-[800px] leading-normal", children: defaultAppletHeader.subHeading }),
76746
+ /* @__PURE__ */ jsx("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: defaultAppletHeader.heading }),
76747
+ /* @__PURE__ */ jsx("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: defaultAppletHeader.subHeading }),
76731
76748
  /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: defaultAppletHeader.tags && defaultAppletHeader.tags.map((tag, index) => /* @__PURE__ */ jsx(
76732
76749
  "span",
76733
76750
  {
@@ -76748,8 +76765,20 @@ const FullConfigPage = ({
76748
76765
  },
76749
76766
  index
76750
76767
  )) }) }),
76751
- /* @__PURE__ */ jsx("div", { className: "p-6 h-full overflow-y-auto", children: tabs[activeTab].content })
76752
- ] })
76768
+ /* @__PURE__ */ jsx("div", { className: "p-8 h-full overflow-y-auto", children: tabs[activeTab].content })
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
+ )
76753
76782
  ] });
76754
76783
  };
76755
76784