najm-kit 0.0.12 → 0.0.14

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/index.d.ts CHANGED
@@ -2315,32 +2315,32 @@ declare const HEADER_COLORS: {
2315
2315
  };
2316
2316
  readonly violet: {
2317
2317
  readonly bg: "bg-violet-600/30";
2318
- readonly text: "[&_th]:text-violet-800 dark:[&_th]:text-violet-200";
2318
+ readonly text: "[&_th]:text-violet-800 dark:[&_th]:text-violet-300";
2319
2319
  readonly row: "hover:bg-violet-500/5";
2320
2320
  };
2321
2321
  readonly blue: {
2322
2322
  readonly bg: "bg-blue-600/30";
2323
- readonly text: "[&_th]:text-blue-800 dark:[&_th]:text-blue-200";
2323
+ readonly text: "[&_th]:text-blue-800 dark:[&_th]:text-blue-300";
2324
2324
  readonly row: "hover:bg-blue-500/5";
2325
2325
  };
2326
2326
  readonly emerald: {
2327
2327
  readonly bg: "bg-emerald-600/30";
2328
- readonly text: "[&_th]:text-emerald-800 dark:[&_th]:text-emerald-200";
2328
+ readonly text: "[&_th]:text-emerald-800 dark:[&_th]:text-emerald-400";
2329
2329
  readonly row: "hover:bg-emerald-500/5";
2330
2330
  };
2331
2331
  readonly amber: {
2332
2332
  readonly bg: "bg-amber-500/30";
2333
- readonly text: "[&_th]:text-amber-800 dark:[&_th]:text-amber-200";
2333
+ readonly text: "[&_th]:text-amber-800 dark:[&_th]:text-amber-300";
2334
2334
  readonly row: "hover:bg-amber-500/5";
2335
2335
  };
2336
2336
  readonly rose: {
2337
2337
  readonly bg: "bg-rose-600/30";
2338
- readonly text: "[&_th]:text-rose-800 dark:[&_th]:text-rose-200";
2338
+ readonly text: "[&_th]:text-rose-800 dark:[&_th]:text-rose-300";
2339
2339
  readonly row: "hover:bg-rose-500/5";
2340
2340
  };
2341
2341
  readonly slate: {
2342
2342
  readonly bg: "bg-slate-700/60";
2343
- readonly text: "[&_th]:text-slate-100 dark:[&_th]:text-slate-300";
2343
+ readonly text: "[&_th]:text-slate-100 dark:[&_th]:text-slate-400";
2344
2344
  readonly row: "hover:bg-slate-500/5";
2345
2345
  };
2346
2346
  };
package/dist/index.mjs CHANGED
@@ -7679,12 +7679,12 @@ function useTableKeyboard(options = {}) {
7679
7679
  // src/components/table/tableColors.ts
7680
7680
  var HEADER_COLORS = {
7681
7681
  primary: { bg: "bg-primary/15", text: "[&_th]:text-primary", row: "hover:bg-primary/5" },
7682
- violet: { bg: "bg-violet-600/30", text: "[&_th]:text-violet-800 dark:[&_th]:text-violet-200", row: "hover:bg-violet-500/5" },
7683
- blue: { bg: "bg-blue-600/30", text: "[&_th]:text-blue-800 dark:[&_th]:text-blue-200", row: "hover:bg-blue-500/5" },
7684
- emerald: { bg: "bg-emerald-600/30", text: "[&_th]:text-emerald-800 dark:[&_th]:text-emerald-200", row: "hover:bg-emerald-500/5" },
7685
- amber: { bg: "bg-amber-500/30", text: "[&_th]:text-amber-800 dark:[&_th]:text-amber-200", row: "hover:bg-amber-500/5" },
7686
- rose: { bg: "bg-rose-600/30", text: "[&_th]:text-rose-800 dark:[&_th]:text-rose-200", row: "hover:bg-rose-500/5" },
7687
- slate: { bg: "bg-slate-700/60", text: "[&_th]:text-slate-100 dark:[&_th]:text-slate-300", row: "hover:bg-slate-500/5" }
7682
+ violet: { bg: "bg-violet-600/30", text: "[&_th]:text-violet-800 dark:[&_th]:text-violet-300", row: "hover:bg-violet-500/5" },
7683
+ blue: { bg: "bg-blue-600/30", text: "[&_th]:text-blue-800 dark:[&_th]:text-blue-300", row: "hover:bg-blue-500/5" },
7684
+ emerald: { bg: "bg-emerald-600/30", text: "[&_th]:text-emerald-800 dark:[&_th]:text-emerald-400", row: "hover:bg-emerald-500/5" },
7685
+ amber: { bg: "bg-amber-500/30", text: "[&_th]:text-amber-800 dark:[&_th]:text-amber-300", row: "hover:bg-amber-500/5" },
7686
+ rose: { bg: "bg-rose-600/30", text: "[&_th]:text-rose-800 dark:[&_th]:text-rose-300", row: "hover:bg-rose-500/5" },
7687
+ slate: { bg: "bg-slate-700/60", text: "[&_th]:text-slate-100 dark:[&_th]:text-slate-400", row: "hover:bg-slate-500/5" }
7688
7688
  };
7689
7689
  var HEADER_HEX = {
7690
7690
  primary: "",
@@ -8188,6 +8188,7 @@ function NTablePagination() {
8188
8188
  fallback: "default"
8189
8189
  });
8190
8190
  const triggerBorderClass = borderColorClassForDegree(resolvedBorderDegree);
8191
+ const useDegreeBorder = bordered || borderDegree || resolvedBorderDegree !== "default";
8191
8192
  if (!table || !showContent || !showPagination || viewMode === "json" || viewMode === "files") return null;
8192
8193
  const filteredRows = table.getFilteredRowModel().rows;
8193
8194
  const selectedRows = table.getFilteredSelectedRowModel().rows;
@@ -8222,7 +8223,14 @@ function NTablePagination() {
8222
8223
  (!isPaginationControlled || manualPagination) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
8223
8224
  /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "Rows/page" }),
8224
8225
  /* @__PURE__ */ jsxs(Select, { value: `${pageSize}`, onValueChange: handlePageSizeChange, children: [
8225
- /* @__PURE__ */ jsx(SelectTrigger, { className: cn("h-8 w-[80px]", bordered && triggerBorderClass), children: /* @__PURE__ */ jsx(SelectValue, { placeholder: pageSize }) }),
8226
+ /* @__PURE__ */ jsx(
8227
+ SelectTrigger,
8228
+ {
8229
+ "data-border-degree": useDegreeBorder ? resolvedBorderDegree : void 0,
8230
+ className: cn("h-8 w-[80px]", useDegreeBorder && triggerBorderClass),
8231
+ children: /* @__PURE__ */ jsx(SelectValue, { placeholder: pageSize })
8232
+ }
8233
+ ),
8226
8234
  /* @__PURE__ */ jsx(SelectContent, { side: "top", children: currentPageSizeOptions.map((size) => /* @__PURE__ */ jsx(SelectItem, { value: `${size}`, children: size }, size)) })
8227
8235
  ] })
8228
8236
  ] }),
@@ -8412,26 +8420,26 @@ function TableSettingsMenu() {
8412
8420
  const modeItems = [];
8413
8421
  if (showViewToggle) {
8414
8422
  if (filteredModes.includes("table"))
8415
- modeItems.push({ value: "table", label: "Table", icon: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" }) });
8423
+ modeItems.push({ value: "table", label: "Table", ariaLabel: "Table view", icon: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" }) });
8416
8424
  if (filteredModes.includes("cards") && cardComponent)
8417
- modeItems.push({ value: "cards", label: "Cards", icon: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4" }) });
8425
+ modeItems.push({ value: "cards", label: "Cards", ariaLabel: "Cards view", icon: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4" }) });
8418
8426
  if (filteredModes.includes("json") && (jsonValue !== void 0 || renderJson))
8419
- modeItems.push({ value: "json", label: "JSON", icon: /* @__PURE__ */ jsx(Code, { className: "h-4 w-4" }) });
8427
+ modeItems.push({ value: "json", label: "JSON", ariaLabel: "JSON view", icon: /* @__PURE__ */ jsx(Code, { className: "h-4 w-4" }) });
8420
8428
  if (filteredModes.includes("files"))
8421
- modeItems.push({ value: "files", label: "Files", icon: /* @__PURE__ */ jsx(FolderOpen, { className: "h-4 w-4" }) });
8429
+ modeItems.push({ value: "files", label: "Files", ariaLabel: "Files view", icon: /* @__PURE__ */ jsx(FolderOpen, { className: "h-4 w-4" }) });
8422
8430
  }
8423
8431
  const columns = table?.getAllColumns?.().filter((c) => c.getCanHide()) ?? [];
8424
8432
  const hasModes = modeItems.length > 0;
8425
8433
  const hasColumns = columns.length > 0;
8426
8434
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
8427
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(BaseInput, { className: "w-auto cursor-pointer px-3", onClick: (e) => e.preventDefault(), bordered, borderDegree, children: /* @__PURE__ */ jsx(SlidersHorizontal, { className: "h-4 w-4 shrink-0 text-muted-foreground" }) }) }),
8435
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(BaseInput, { "aria-label": "Table settings", className: "w-auto cursor-pointer px-3", bordered, borderDegree, children: /* @__PURE__ */ jsx(SlidersHorizontal, { className: "h-4 w-4 shrink-0 text-muted-foreground" }) }) }),
8428
8436
  /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-56 bg-card", children: [
8429
8437
  showViewToggle && hasModes && /* @__PURE__ */ jsxs(Fragment, { children: [
8430
8438
  /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: "flex items-center gap-2", children: [
8431
8439
  /* @__PURE__ */ jsx(Eye, { className: "h-3.5 w-3.5" }),
8432
8440
  "View"
8433
8441
  ] }),
8434
- /* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: viewMode, onValueChange: (v) => setViewMode(v), children: modeItems.map((item) => /* @__PURE__ */ jsxs(DropdownMenuRadioItem, { value: item.value, children: [
8442
+ /* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: viewMode, onValueChange: (v) => setViewMode(v), children: modeItems.map((item) => /* @__PURE__ */ jsxs(DropdownMenuRadioItem, { value: item.value, "aria-label": item.ariaLabel, children: [
8435
8443
  item.icon,
8436
8444
  /* @__PURE__ */ jsx("span", { children: item.label })
8437
8445
  ] }, item.value)) })
@@ -8478,10 +8486,10 @@ function NTableHeader() {
8478
8486
  const hideDataChrome = isLoading || error || hasNoData && !isFilteredEmpty;
8479
8487
  if (isCustomMode) {
8480
8488
  if (!showViewToggle && !showColumnVisibility && !headerSlot && !hasControls) return null;
8481
- if (hideDataChrome && !hasControls) return null;
8482
- const justify2 = headerSlot && !hideDataChrome ? "justify-between" : "justify-end";
8489
+ if (hideDataChrome) return null;
8490
+ const justify2 = headerSlot ? "justify-between" : "justify-end";
8483
8491
  return /* @__PURE__ */ jsxs("div", { "data-ntable-header": true, className: cn("flex shrink-0 items-center gap-3 flex-wrap lg:flex-nowrap", justify2, classNames?.header), children: [
8484
- headerSlot && !hideDataChrome && /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: headerSlot }),
8492
+ headerSlot && /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: headerSlot }),
8485
8493
  hasControls && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 shrink-0", children: [
8486
8494
  /* @__PURE__ */ jsx(TableSettingsMenu, {}),
8487
8495
  /* @__PURE__ */ jsx(TableAddButton, {})
@@ -8491,13 +8499,12 @@ function NTableHeader() {
8491
8499
  const hasFilters = Array.isArray(filters) && filters.length > 0;
8492
8500
  const hasToolbar = Boolean(renderToolbar);
8493
8501
  if (!hasFilters && !hasControls && !headerSlot && !hasToolbar) return null;
8494
- if (hideDataChrome && !hasControls) return null;
8495
- const onlyControls = hideDataChrome && hasControls && !headerSlot && !hasToolbar;
8496
- const justify = onlyControls ? "justify-end" : hasControls || headerSlot || hasToolbar ? "justify-between" : "justify-start";
8502
+ if (hideDataChrome) return null;
8503
+ const justify = hasControls || headerSlot || hasToolbar ? "justify-between" : "justify-start";
8497
8504
  return /* @__PURE__ */ jsxs("div", { "data-ntable-header": true, className: cn("flex shrink-0 items-center gap-3 flex-wrap lg:flex-nowrap", justify, classNames?.header), children: [
8498
- !hideDataChrome && /* @__PURE__ */ jsx(TableFilters, {}),
8499
- headerSlot && !hideDataChrome && /* @__PURE__ */ jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: headerSlot }),
8500
- !hideDataChrome && /* @__PURE__ */ jsx(TableToolbarSlot, {}),
8505
+ /* @__PURE__ */ jsx(TableFilters, {}),
8506
+ headerSlot && /* @__PURE__ */ jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: headerSlot }),
8507
+ /* @__PURE__ */ jsx(TableToolbarSlot, {}),
8501
8508
  hasControls && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 shrink-0", children: [
8502
8509
  /* @__PURE__ */ jsx(TableSettingsMenu, {}),
8503
8510
  /* @__PURE__ */ jsx(TableAddButton, {})
package/dist/styles.css CHANGED
@@ -5016,29 +5016,29 @@ video {
5016
5016
  --tw-text-opacity: 1;
5017
5017
  color: rgb(91 33 182 / var(--tw-text-opacity, 1));
5018
5018
  }
5019
- .dark\:\[\&_th\]\:text-amber-200 th:is(.dark *) {
5019
+ .dark\:\[\&_th\]\:text-amber-300 th:is(.dark *) {
5020
5020
  --tw-text-opacity: 1;
5021
- color: rgb(253 230 138 / var(--tw-text-opacity, 1));
5021
+ color: rgb(252 211 77 / var(--tw-text-opacity, 1));
5022
5022
  }
5023
- .dark\:\[\&_th\]\:text-blue-200 th:is(.dark *) {
5023
+ .dark\:\[\&_th\]\:text-blue-300 th:is(.dark *) {
5024
5024
  --tw-text-opacity: 1;
5025
- color: rgb(191 219 254 / var(--tw-text-opacity, 1));
5025
+ color: rgb(147 197 253 / var(--tw-text-opacity, 1));
5026
5026
  }
5027
- .dark\:\[\&_th\]\:text-emerald-200 th:is(.dark *) {
5027
+ .dark\:\[\&_th\]\:text-emerald-400 th:is(.dark *) {
5028
5028
  --tw-text-opacity: 1;
5029
- color: rgb(167 243 208 / var(--tw-text-opacity, 1));
5029
+ color: rgb(52 211 153 / var(--tw-text-opacity, 1));
5030
5030
  }
5031
- .dark\:\[\&_th\]\:text-rose-200 th:is(.dark *) {
5031
+ .dark\:\[\&_th\]\:text-rose-300 th:is(.dark *) {
5032
5032
  --tw-text-opacity: 1;
5033
- color: rgb(254 205 211 / var(--tw-text-opacity, 1));
5033
+ color: rgb(253 164 175 / var(--tw-text-opacity, 1));
5034
5034
  }
5035
- .dark\:\[\&_th\]\:text-slate-300 th:is(.dark *) {
5035
+ .dark\:\[\&_th\]\:text-slate-400 th:is(.dark *) {
5036
5036
  --tw-text-opacity: 1;
5037
- color: rgb(203 213 225 / var(--tw-text-opacity, 1));
5037
+ color: rgb(148 163 184 / var(--tw-text-opacity, 1));
5038
5038
  }
5039
- .dark\:\[\&_th\]\:text-violet-200 th:is(.dark *) {
5039
+ .dark\:\[\&_th\]\:text-violet-300 th:is(.dark *) {
5040
5040
  --tw-text-opacity: 1;
5041
- color: rgb(221 214 254 / var(--tw-text-opacity, 1));
5041
+ color: rgb(196 181 253 / var(--tw-text-opacity, 1));
5042
5042
  }
5043
5043
  .\[\&_tr\:last-child\]\:border-0 tr:last-child {
5044
5044
  border-width: 0px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najm-kit",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "description": "Reusable React UI component package for Najm framework",
6
6
  "main": "./dist/index.mjs",