@nestledjs/data-browser 1.0.0 → 1.0.2

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.
@@ -86,7 +86,7 @@ function AdminDataCreatePageContent({ model, basePath, formTheme, displayFieldCo
86
86
  var _a, _b;
87
87
  if (!(documents == null ? void 0 : documents.create)) return null;
88
88
  try {
89
- if (((_a = documents.create) == null ? void 0 : _a.definitions) && ((_b = documents.create) == null ? void 0 : _b.loc)) {
89
+ if (((_a = documents.create) == null ? void 0 : _a.kind) === "Document" && ((_b = documents.create) == null ? void 0 : _b.definitions)) {
90
90
  return documents.create;
91
91
  }
92
92
  return gql(documents.create);
@@ -348,7 +348,7 @@ function AdminDataEditPageContent({ model, id, basePath, formTheme, displayField
348
348
  var _a, _b;
349
349
  if (!(documents == null ? void 0 : documents.query)) return null;
350
350
  try {
351
- if (((_a = documents.query) == null ? void 0 : _a.definitions) && ((_b = documents.query) == null ? void 0 : _b.loc)) {
351
+ if (((_a = documents.query) == null ? void 0 : _a.kind) === "Document" && ((_b = documents.query) == null ? void 0 : _b.definitions)) {
352
352
  return documents.query;
353
353
  }
354
354
  return gql(documents.query);
@@ -360,7 +360,7 @@ function AdminDataEditPageContent({ model, id, basePath, formTheme, displayField
360
360
  var _a, _b;
361
361
  if (!(documents == null ? void 0 : documents.update)) return null;
362
362
  try {
363
- if (((_a = documents.update) == null ? void 0 : _a.definitions) && ((_b = documents.update) == null ? void 0 : _b.loc)) {
363
+ if (((_a = documents.update) == null ? void 0 : _a.kind) === "Document" && ((_b = documents.update) == null ? void 0 : _b.definitions)) {
364
364
  return documents.update;
365
365
  }
366
366
  return gql(documents.update);
@@ -372,7 +372,7 @@ function AdminDataEditPageContent({ model, id, basePath, formTheme, displayField
372
372
  var _a, _b;
373
373
  if (!(documents == null ? void 0 : documents.delete)) return null;
374
374
  try {
375
- if (((_a = documents.delete) == null ? void 0 : _a.definitions) && ((_b = documents.delete) == null ? void 0 : _b.loc)) {
375
+ if (((_a = documents.delete) == null ? void 0 : _a.kind) === "Document" && ((_b = documents.delete) == null ? void 0 : _b.definitions)) {
376
376
  return documents.delete;
377
377
  }
378
378
  return gql(documents.delete);
@@ -447,7 +447,7 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
447
447
  "button",
448
448
  {
449
449
  onClick: () => setShowColumnSelector(!showColumnSelector),
450
- className: "inline-flex items-center px-3 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web",
450
+ className: "inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web",
451
451
  children: [
452
452
  "Columns",
453
453
  /* @__PURE__ */ jsx(
@@ -470,8 +470,8 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
470
470
  ]
471
471
  }
472
472
  ),
473
- showColumnSelector && /* @__PURE__ */ jsx("div", { className: "absolute right-0 mt-2 w-80 bg-white rounded-md shadow-lg z-50 border border-gray-200", children: /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
474
- /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-900 mb-3", children: "Visible Columns" }),
473
+ showColumnSelector && /* @__PURE__ */ jsx("div", { className: "absolute right-0 mt-2 w-80 bg-white dark:bg-gray-800 rounded-md shadow-lg z-50 border border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
474
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-900 dark:text-gray-100 mb-3", children: "Visible Columns" }),
475
475
  /* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto", children: fieldNames.map((field) => /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2 cursor-pointer", children: [
476
476
  /* @__PURE__ */ jsx(
477
477
  "input",
@@ -483,12 +483,12 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
483
483
  setVisibleColumns(newColumns);
484
484
  AdminLocalStorage.setColumnVisibility(model.name, newColumns);
485
485
  },
486
- className: "h-4 w-4 mt-0.5 flex-shrink-0 text-green-web focus:ring-green-web border-gray-300 rounded"
486
+ className: "h-4 w-4 mt-0.5 flex-shrink-0 text-green-web focus:ring-green-web border-gray-300 dark:border-gray-600 rounded"
487
487
  }
488
488
  ),
489
- /* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700 leading-5", children: formatFieldName(field) })
489
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700 dark:text-gray-300 leading-5", children: formatFieldName(field) })
490
490
  ] }, field)) }),
491
- /* @__PURE__ */ jsxs("div", { className: "mt-3 pt-3 border-t border-gray-200 flex justify-between", children: [
491
+ /* @__PURE__ */ jsxs("div", { className: "mt-3 pt-3 border-t border-gray-200 dark:border-gray-700 flex justify-between", children: [
492
492
  /* @__PURE__ */ jsx(
493
493
  "button",
494
494
  {
@@ -508,7 +508,7 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
508
508
  setVisibleColumns(defaults);
509
509
  AdminLocalStorage.setColumnVisibility(model.name, defaults);
510
510
  },
511
- className: "text-xs text-gray-600 hover:text-gray-800",
511
+ className: "text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",
512
512
  children: "Reset to Defaults"
513
513
  }
514
514
  )
@@ -520,7 +520,7 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
520
520
  "button",
521
521
  {
522
522
  onClick: () => setShowSearchFieldSelector(!showSearchFieldSelector),
523
- className: "h-full px-3 border-l border-gray-300 text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600",
523
+ className: "h-full px-3 border-l border-gray-300 dark:border-gray-600 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 focus:outline-none focus:text-gray-600 dark:focus:text-gray-300",
524
524
  "aria-label": "Configure search fields",
525
525
  children: /* @__PURE__ */ jsx(
526
526
  "svg",
@@ -541,8 +541,8 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
541
541
  )
542
542
  }
543
543
  ),
544
- showSearchFieldSelector && /* @__PURE__ */ jsx("div", { className: "absolute right-0 mt-2 w-72 bg-white rounded-md shadow-lg z-50 border border-gray-200", children: /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
545
- /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-900 mb-3", children: "Search Fields" }),
544
+ showSearchFieldSelector && /* @__PURE__ */ jsx("div", { className: "absolute right-0 mt-2 w-72 bg-white dark:bg-gray-800 rounded-md shadow-lg z-50 border border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
545
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-900 dark:text-gray-100 mb-3", children: "Search Fields" }),
546
546
  searchableFieldNames.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
547
547
  /* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-48 overflow-y-auto", children: searchableFieldNames.map((field) => /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2 cursor-pointer", children: [
548
548
  /* @__PURE__ */ jsx(
@@ -555,12 +555,12 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
555
555
  setSearchFields(newFields);
556
556
  AdminLocalStorage.setSearchFields(model.name, newFields);
557
557
  },
558
- className: "h-4 w-4 mt-0.5 flex-shrink-0 text-green-web focus:ring-green-web border-gray-300 rounded"
558
+ className: "h-4 w-4 mt-0.5 flex-shrink-0 text-green-web focus:ring-green-web border-gray-300 dark:border-gray-600 rounded"
559
559
  }
560
560
  ),
561
- /* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700 leading-5", children: formatFieldName(field) })
561
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700 dark:text-gray-300 leading-5", children: formatFieldName(field) })
562
562
  ] }, field)) }),
563
- /* @__PURE__ */ jsxs("div", { className: "mt-3 pt-3 border-t border-gray-200 flex justify-between", children: [
563
+ /* @__PURE__ */ jsxs("div", { className: "mt-3 pt-3 border-t border-gray-200 dark:border-gray-700 flex justify-between", children: [
564
564
  /* @__PURE__ */ jsx(
565
565
  "button",
566
566
  {
@@ -580,17 +580,17 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
580
580
  setSearchFields(defaults);
581
581
  AdminLocalStorage.setSearchFields(model.name, defaults);
582
582
  },
583
- className: "text-xs text-gray-600 hover:text-gray-800",
583
+ className: "text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",
584
584
  children: "Reset to Defaults"
585
585
  }
586
586
  )
587
587
  ] })
588
- ] }) : /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-500", children: "No searchable text fields available" })
588
+ ] }) : /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: "No searchable text fields available" })
589
589
  ] }) })
590
590
  ] });
591
- const filterPanel = showFilters && /* @__PURE__ */ jsxs("div", { className: "mb-4 bg-gray-50 border border-gray-200 rounded-lg p-4", children: [
591
+ const filterPanel = showFilters && /* @__PURE__ */ jsxs("div", { className: "mb-4 bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4", children: [
592
592
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
593
- /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-900", children: "Filters" }),
593
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Filters" }),
594
594
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
595
595
  /* @__PURE__ */ jsx(
596
596
  "button",
@@ -599,7 +599,7 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
599
599
  setFilters({});
600
600
  dispatch({ type: "RESET_PAGINATION" });
601
601
  },
602
- className: "text-xs text-gray-600 hover:text-gray-800",
602
+ className: "text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200",
603
603
  children: "Clear All"
604
604
  }
605
605
  ),
@@ -607,7 +607,7 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
607
607
  "button",
608
608
  {
609
609
  onClick: () => setShowFilters(false),
610
- className: "text-gray-400 hover:text-gray-600",
610
+ className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
611
611
  children: /* @__PURE__ */ jsx(
612
612
  "svg",
613
613
  {
@@ -712,7 +712,7 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
712
712
  {
713
713
  id: "search",
714
714
  name: "search",
715
- className: "block w-full pl-10 pr-12 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-1 focus:ring-green-web focus:border-green-web sm:text-sm",
715
+ className: "block w-full pl-10 pr-12 py-2 border border-gray-300 dark:border-gray-600 rounded-md leading-5 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:placeholder-gray-400 dark:focus:placeholder-gray-500 focus:ring-1 focus:ring-green-web focus:border-green-web sm:text-sm",
716
716
  placeholder: `Search ${searchFields.length > 0 ? searchFields.map((field) => field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (str) => str.toUpperCase())).join(", ") : getPluralName(model.name).toLowerCase()}...`,
717
717
  type: "search",
718
718
  value: state.search || "",
@@ -727,7 +727,7 @@ function AdminDataListPage({ modelName: propModelName } = {}) {
727
727
  "button",
728
728
  {
729
729
  onClick: () => setShowFilters(!showFilters),
730
- className: `inline-flex items-center px-3 py-2 border text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web ${showFilters || Object.keys(filters).length > 0 ? "border-green-web text-green-web bg-green-50 hover:bg-green-100" : "border-gray-300 text-gray-700 bg-white hover:bg-gray-50"}`,
730
+ className: `inline-flex items-center px-3 py-2 border text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-web ${showFilters || Object.keys(filters).length > 0 ? "border-green-web text-green-web bg-green-50 dark:bg-green-900/30 hover:bg-green-100 dark:hover:bg-green-900/50" : "border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700"}`,
731
731
  children: [
732
732
  /* @__PURE__ */ jsx("svg", { className: "w-4 h-4 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx(
733
733
  "path",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestledjs/data-browser",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Universal admin data browser for Nestled framework projects with full CRUD operations",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -38,7 +38,7 @@
38
38
  "@apollo/client": "^4.0.0",
39
39
  "@heroicons/react": "^2.0.0",
40
40
  "@nestledjs/forms": "^0.5.0",
41
- "@nestledjs/shared-components": "^1.0.0",
41
+ "@nestledjs/shared-components": "^1.0.2",
42
42
  "react": "^19.0.0",
43
43
  "react-router": "^7.0.0"
44
44
  },