najm-kit 2.11.11 → 2.11.13

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.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { resolveAvatarSrc } from './chunk-BEGOH366.mjs';
2
2
  export { isPlaceholderAvatar, resolveAvatarSrc } from './chunk-BEGOH366.mjs';
3
- import { NLoadingState, NErrorState, NEmptyState, useResolvedFormDevTools, useNBranding } from './chunk-W2HMBUZ4.mjs';
4
- export { FormDevToolsProvider, NBrandingProvider, NBrandingStateProvider, NEmptyState, NErrorState, NForbiddenState, NLoadingState, NNotFoundState, NPageLayout, NSpinner, NajmFormatProvider, buildFormFill, normalizeBranding, useNBranding, useNBrandingEditor, useNajmFormat, useNajmFormatContext } from './chunk-W2HMBUZ4.mjs';
5
- import { normalizeImageSources, useImageChain, useNBadgeDefaults, mergeBadgeMaps, resolveStatusColor, resolveBadgeStatusLabel, colorTextClass, useResolvedPaginationLabels } from './chunk-6UDJNTJ6.mjs';
6
- export { DEFAULT_PAGINATION_KEY_PREFIX, DEFAULT_TIME_ZONE, EMPTY_DESIGN, NAJM_COLOR_TEXT_CLASSES, NAJM_STATUS_COLORS, NTableDefaultsProvider, NajmDesignEditorProvider, NajmPreferencesProvider, NajmUIProvider, buildPaginationLabels, colorTextClass, findStatusColor, normalizeStatusToken, resolveStatusColor, statusTextClass, useNTableDefaults, useNajmDesignEditor, useNajmPreferencesContext, useNajmTheme, useNajmTimeZone } from './chunk-6UDJNTJ6.mjs';
3
+ import { NLoadingState, NErrorState, NEmptyState, useResolvedFormDevTools, useNBranding } from './chunk-26EASWUY.mjs';
4
+ export { FormDevToolsProvider, NBrandingProvider, NBrandingStateProvider, NEmptyState, NErrorState, NForbiddenState, NLoadingState, NNotFoundState, NPageLayout, NSpinner, NajmFormatProvider, buildFormFill, normalizeBranding, useNBranding, useNBrandingEditor, useNajmFormat, useNajmFormatContext } from './chunk-26EASWUY.mjs';
5
+ import { normalizeImageSources, useImageChain, useNBadgeDefaults, mergeBadgeMaps, resolveStatusColor, resolveBadgeStatusLabel, colorTextClass, useResolvedPaginationLabels, useResolvedToolbarLabels } from './chunk-BDQK6ECA.mjs';
6
+ export { DEFAULT_FEEDBACK_KEY_PREFIX, DEFAULT_PAGINATION_KEY_PREFIX, DEFAULT_TIME_ZONE, DEFAULT_TOOLBAR_KEY_PREFIX, EMPTY_DESIGN, NAJM_COLOR_TEXT_CLASSES, NAJM_STATUS_COLORS, NTableDefaultsProvider, NajmDesignEditorProvider, NajmPreferencesProvider, NajmUIProvider, buildPaginationLabels, buildToolbarLabels, colorTextClass, findStatusColor, normalizeStatusToken, resolveStatusColor, statusTextClass, useDocumentDirection, useNTableDefaults, useNajmDesignEditor, useNajmPreferencesContext, useNajmTheme, useNajmTimeZone, useResolvedToolbarLabels } from './chunk-BDQK6ECA.mjs';
7
7
  import { NajmScroll, useNajmScrollViewport, useTableStore, TableStoreContext, NTableJson } from './chunk-5JVFMOLI.mjs';
8
8
  export { NTableJson, NajmScroll, TableStoreContext, useTableStore } from './chunk-5JVFMOLI.mjs';
9
9
  import { inputBorderClasses, Button, NIcon, surfaceBorderClasses, buttonVariants, NButton, sidebarBorderClasses } from './chunk-M5VGBZ7R.mjs';
@@ -21,7 +21,7 @@ import * as React66 from 'react';
21
21
  import React66__default, { createContext, useState, useRef, useMemo, useEffect, useContext, useCallback, useLayoutEffect, isValidElement } from 'react';
22
22
  import * as TabsPrimitive from '@radix-ui/react-tabs';
23
23
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
24
- import { Eye, EyeOff, Clock, ChevronDown, AlertTriangle, RefreshCw, X, XIcon, Menu, Search, SearchIcon, CheckIcon, ChevronUp, ChevronDownIcon, ChevronUpIcon, ChevronsUpDown, Check, CircleIcon, ChevronLeftIcon, ChevronRightIcon, Calendar as Calendar$1, FileUp, Folder, UploadCloud, CheckCircle2, AlertCircle, Camera, Star, Globe, Trash2, Plus, Upload, Download, RotateCcw, Table as Table$1, FileJson, ChevronRight, ArrowUpDown, Loader2, Copy, MoreVertical, Edit, ChevronsLeft, ChevronLeft, ChevronsRight, Pencil, Merge, PanelLeftOpen, PanelLeftClose, LogOut, Image, ArrowUp, ArrowDown, CheckSquare, FilePlus, FolderPlus, Share2, Move, ClipboardPaste, Scissors, ArrowUpRight, ArrowDownRight, SlidersHorizontal, Columns3, Settings, Filter, SearchX, Inbox, List, LayoutGrid, Code, FolderOpen } from 'lucide-react';
24
+ import { Eye, EyeOff, Clock, ChevronDown, AlertTriangle, RefreshCw, X, XIcon, Menu, Search, SearchIcon, CheckIcon, ChevronUp, ChevronDownIcon, ChevronUpIcon, ChevronsUpDown, Check, CircleIcon, ChevronLeftIcon, ChevronRightIcon, Calendar as Calendar$1, FileUp, Folder, UploadCloud, CheckCircle2, AlertCircle, Camera, Star, Globe, Trash2, Plus, Upload, Download, RotateCcw, Table as Table$1, FileJson, ChevronRight, ArrowUpDown, Loader2, Copy, MoreVertical, Edit, ChevronsLeft, ChevronLeft, ChevronsRight, Pencil, Merge, PanelLeftOpen, PanelLeftClose, LogOut, Image, ArrowUp, ArrowDown, CheckSquare, FilePlus, FolderPlus, Share2, Move, ClipboardPaste, Scissors, ArrowUpRight, ArrowDownRight, List, LayoutGrid, Code, FolderOpen, SlidersHorizontal, Columns3, Settings, Filter, SearchX, Inbox } from 'lucide-react';
25
25
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
26
26
  import { cva } from 'class-variance-authority';
27
27
  import { HexColorPicker } from 'react-colorful';
@@ -2811,10 +2811,10 @@ function SelectItem({ className, children, ...props }) {
2811
2811
  SelectPrimitive.Item,
2812
2812
  {
2813
2813
  "data-slot": "select-item",
2814
- className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
2814
+ className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
2815
2815
  ...props,
2816
2816
  children: [
2817
- /* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
2817
+ /* @__PURE__ */ jsx("span", { className: "absolute end-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
2818
2818
  /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
2819
2819
  ]
2820
2820
  }
@@ -5985,11 +5985,11 @@ function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
5985
5985
  DropdownMenuPrimitive.CheckboxItem,
5986
5986
  {
5987
5987
  "data-slot": "dropdown-menu-checkbox-item",
5988
- className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
5988
+ className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
5989
5989
  checked,
5990
5990
  ...props,
5991
5991
  children: [
5992
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
5992
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute start-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
5993
5993
  children
5994
5994
  ]
5995
5995
  }
@@ -6000,10 +6000,10 @@ function DropdownMenuRadioItem({ className, children, ...props }) {
6000
6000
  DropdownMenuPrimitive.RadioItem,
6001
6001
  {
6002
6002
  "data-slot": "dropdown-menu-radio-item",
6003
- className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
6003
+ className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
6004
6004
  ...props,
6005
6005
  children: [
6006
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
6006
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute start-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
6007
6007
  children
6008
6008
  ]
6009
6009
  }
@@ -6596,7 +6596,7 @@ function NThemePresets({
6596
6596
  SelectItem,
6597
6597
  {
6598
6598
  value: row.value,
6599
- className: "pr-2 pl-8 [&>span:first-child]:right-auto [&>span:first-child]:left-2 [&>span:first-child]:text-success [&>span:last-child]:min-w-0 [&>span:last-child]:flex-1",
6599
+ className: "pe-2 ps-8 [&>span:first-child]:end-auto [&>span:first-child]:start-2 [&>span:first-child]:text-success [&>span:last-child]:min-w-0 [&>span:last-child]:flex-1",
6600
6600
  children: /* @__PURE__ */ jsxs("span", { className: "flex w-full min-w-0 items-center gap-2", children: [
6601
6601
  /* @__PURE__ */ jsx(ThemeSwatch, { design: row.design }),
6602
6602
  /* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: row.label }),
@@ -11621,7 +11621,7 @@ var createTableStore = (seed) => {
11621
11621
  showColumnVisibility: false,
11622
11622
  showAddButton: true,
11623
11623
  showViewToggle: true,
11624
- toolbarLabels: true,
11624
+ toolbarLabels: {},
11625
11625
  dynamicHeight: true,
11626
11626
  showContent: false,
11627
11627
  isTableView: true,
@@ -12637,7 +12637,7 @@ function NDataCardShell({ row, onClick, onContextMenu, actions, children, classN
12637
12637
  className
12638
12638
  ),
12639
12639
  children: [
12640
- showCheckbox && /* @__PURE__ */ jsx("div", { className: cn("absolute top-2 left-2 z-10 transition-opacity duration-200", isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100"), children: /* @__PURE__ */ jsx(
12640
+ showCheckbox && /* @__PURE__ */ jsx("div", { className: cn("absolute top-2 start-2 z-10 transition-opacity duration-200", isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100"), children: /* @__PURE__ */ jsx(
12641
12641
  Checkbox,
12642
12642
  {
12643
12643
  checked: isSelected,
@@ -12680,7 +12680,7 @@ function NDataCardShell({ row, onClick, onContextMenu, actions, children, classN
12680
12680
  },
12681
12681
  className: "cursor-pointer",
12682
12682
  children: [
12683
- /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4 mr-2" }),
12683
+ /* @__PURE__ */ jsx(Eye, { className: "h-4 w-4 me-2" }),
12684
12684
  "View"
12685
12685
  ]
12686
12686
  }
@@ -12694,7 +12694,7 @@ function NDataCardShell({ row, onClick, onContextMenu, actions, children, classN
12694
12694
  },
12695
12695
  className: "cursor-pointer",
12696
12696
  children: [
12697
- /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-2" }),
12697
+ /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 me-2" }),
12698
12698
  "Edit"
12699
12699
  ]
12700
12700
  }
@@ -12708,7 +12708,7 @@ function NDataCardShell({ row, onClick, onContextMenu, actions, children, classN
12708
12708
  },
12709
12709
  className: "cursor-pointer text-red-500",
12710
12710
  children: [
12711
- /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4 mr-2 text-red-500" }),
12711
+ /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4 me-2 text-red-500" }),
12712
12712
  "Delete"
12713
12713
  ]
12714
12714
  }
@@ -12726,10 +12726,10 @@ function NDataCardShell({ row, onClick, onContextMenu, actions, children, classN
12726
12726
  row.toggleExpanded();
12727
12727
  },
12728
12728
  className: cn(
12729
- "absolute bottom-2 right-2 z-10 flex h-6 w-6 items-center justify-center rounded hover:bg-muted",
12729
+ "absolute bottom-2 end-2 z-10 flex h-6 w-6 items-center justify-center rounded hover:bg-muted",
12730
12730
  bordered && "border border-border"
12731
12731
  ),
12732
- children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
12732
+ children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 rtl:rotate-180" })
12733
12733
  }
12734
12734
  ),
12735
12735
  children
@@ -13531,6 +13531,27 @@ function NTablePagination() {
13531
13531
  /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-none whitespace-nowrap text-sm text-muted-foreground max-sm:hidden", children: labels.rowsSelected?.(selectedRows.length, selectedTotal) ?? `${selectedRows.length} of ${selectedTotal} row(s) selected.` })
13532
13532
  ] });
13533
13533
  }
13534
+ function useToolbarCopy() {
13535
+ const own = useTableStore.use.toolbarLabels();
13536
+ const labels = useResolvedToolbarLabels(own);
13537
+ return React66__default.useMemo(
13538
+ () => ({
13539
+ settings: labels.settings ?? "Table settings",
13540
+ view: labels.view ?? "View",
13541
+ columns: labels.columns ?? "Columns",
13542
+ modeTable: labels.modeTable ?? "Table",
13543
+ modeCards: labels.modeCards ?? "Cards",
13544
+ modeJson: labels.modeJson ?? "JSON",
13545
+ modeFiles: labels.modeFiles ?? "Files",
13546
+ modeOption: labels.modeOption ?? ((mode) => `${mode} view`),
13547
+ filters: labels.filters ?? "Filters",
13548
+ filterRegion: labels.filterRegion ?? "Table filters",
13549
+ allOption: labels.allOption ?? "All",
13550
+ create: labels.create ?? "Create"
13551
+ }),
13552
+ [labels]
13553
+ );
13554
+ }
13534
13555
  function PendingFilter({ placeholder, icon, bordered }) {
13535
13556
  return /* @__PURE__ */ jsx(TextInput, { icon, value: "", onChange: () => {
13536
13557
  }, placeholder, bordered, disabled: true });
@@ -13552,9 +13573,10 @@ function TextFilter({ name, placeholder, icon }) {
13552
13573
  function SelectFilter({ name, options, placeholder, inputType }) {
13553
13574
  const table = useTableStore.use.table();
13554
13575
  const bordered = useTableStore.use.bordered();
13576
+ const copy = useToolbarCopy();
13555
13577
  const column = table?.getColumn?.(name);
13556
13578
  if (!column) return /* @__PURE__ */ jsx(PendingFilter, { placeholder: placeholder || "Filter...", bordered });
13557
- const allOptions = [{ value: "__clear__", label: "All" }, ...options.map((o) => typeof o === "string" ? { value: o, label: o } : o)];
13579
+ const allOptions = [{ value: "__clear__", label: copy.allOption }, ...options.map((o) => typeof o === "string" ? { value: o, label: o } : o)];
13558
13580
  const InputComponent = inputType === "combobox" ? ComboboxInput : SelectInput;
13559
13581
  return /* @__PURE__ */ jsx(InputComponent, { value: column.getFilterValue() ?? "", onChange: (value) => column.setFilterValue(value === "" || value === "__clear__" ? void 0 : value), items: allOptions, placeholder: placeholder || "Filter...", bordered });
13560
13582
  }
@@ -13652,6 +13674,7 @@ function TableAddButton({ mobile = false }) {
13652
13674
  const onAddClick = useTableStore.use.onAddClick();
13653
13675
  const showAddButton = useTableStore.use.showAddButton();
13654
13676
  const addButtonText = useTableStore.use.addButtonText();
13677
+ const copy = useToolbarCopy();
13655
13678
  const headerColor = useTableStore.use.headerColor();
13656
13679
  const headerTextColor = useTableStore.use.headerTextColor();
13657
13680
  const bordered = useTableStore.use.bordered();
@@ -13667,8 +13690,8 @@ function TableAddButton({ mobile = false }) {
13667
13690
  type: "button",
13668
13691
  onClick: onAddClick ?? void 0,
13669
13692
  style: btnStyle,
13670
- "aria-label": addButtonText || "Create",
13671
- title: addButtonText || "Create",
13693
+ "aria-label": addButtonText || copy.create,
13694
+ title: addButtonText || copy.create,
13672
13695
  "data-bordered": bordered === false ? "false" : "true",
13673
13696
  className: cn(
13674
13697
  "h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors hover:opacity-90",
@@ -13680,14 +13703,15 @@ function TableAddButton({ mobile = false }) {
13680
13703
  }
13681
13704
  function MobileFiltersMenu({ filters }) {
13682
13705
  const bordered = useTableStore.use.bordered();
13706
+ const copy = useToolbarCopy();
13683
13707
  if (!filters.length) return null;
13684
13708
  return /* @__PURE__ */ jsxs(Popover, { children: [
13685
13709
  /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
13686
13710
  "button",
13687
13711
  {
13688
13712
  type: "button",
13689
- "aria-label": "Filters",
13690
- title: "Filters",
13713
+ "aria-label": copy.filters,
13714
+ title: copy.filters,
13691
13715
  "data-bordered": bordered === false ? "false" : "true",
13692
13716
  className: cn(
13693
13717
  "flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-lg bg-card text-primary transition-colors hover:border-primary/70",
@@ -13700,7 +13724,7 @@ function MobileFiltersMenu({ filters }) {
13700
13724
  PopoverContent,
13701
13725
  {
13702
13726
  align: "end",
13703
- "aria-label": "Table filters",
13727
+ "aria-label": copy.filterRegion,
13704
13728
  className: "w-[min(20rem,calc(100vw-2rem))] space-y-3 bg-card p-3",
13705
13729
  children: filters.map((filter) => /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsx(RenderFilter, { filter }) }, filter.name))
13706
13730
  }
@@ -13727,30 +13751,31 @@ function TableSettingsMenu() {
13727
13751
  const cardComponent = useTableStore.use.CardComponent();
13728
13752
  const table = useTableStore.use.table();
13729
13753
  const bordered = useTableStore.use.bordered();
13754
+ const copy = useToolbarCopy();
13730
13755
  if (!showViewToggle && !showColumnVisibility) return null;
13731
13756
  const allModes = ["table", "cards", "json", "files"];
13732
13757
  const filteredModes = availableModes ?? allModes;
13733
13758
  const modeItems = [];
13734
13759
  if (showViewToggle) {
13735
13760
  if (filteredModes.includes("table"))
13736
- modeItems.push({ value: "table", label: "Table", ariaLabel: "Table view", icon: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" }) });
13761
+ modeItems.push({ value: "table", label: copy.modeTable, ariaLabel: copy.modeOption(copy.modeTable), icon: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" }) });
13737
13762
  if (filteredModes.includes("cards") && cardComponent)
13738
- modeItems.push({ value: "cards", label: "Cards", ariaLabel: "Cards view", icon: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4" }) });
13763
+ modeItems.push({ value: "cards", label: copy.modeCards, ariaLabel: copy.modeOption(copy.modeCards), icon: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4" }) });
13739
13764
  if (filteredModes.includes("json") && (jsonValue !== void 0 || renderJson))
13740
- modeItems.push({ value: "json", label: "JSON", ariaLabel: "JSON view", icon: /* @__PURE__ */ jsx(Code, { className: "h-4 w-4" }) });
13765
+ modeItems.push({ value: "json", label: copy.modeJson, ariaLabel: copy.modeOption(copy.modeJson), icon: /* @__PURE__ */ jsx(Code, { className: "h-4 w-4" }) });
13741
13766
  if (filteredModes.includes("files"))
13742
- modeItems.push({ value: "files", label: "Files", ariaLabel: "Files view", icon: /* @__PURE__ */ jsx(FolderOpen, { className: "h-4 w-4" }) });
13767
+ modeItems.push({ value: "files", label: copy.modeFiles, ariaLabel: copy.modeOption(copy.modeFiles), icon: /* @__PURE__ */ jsx(FolderOpen, { className: "h-4 w-4" }) });
13743
13768
  }
13744
13769
  const columns = table?.getAllColumns?.().filter((c) => c.getCanHide()) ?? [];
13745
13770
  const hasModes = modeItems.length > 0;
13746
13771
  const hasColumns = columns.length > 0;
13747
13772
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
13748
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(BaseInput, { "aria-label": "Table settings", className: "w-auto cursor-pointer px-3", bordered, children: /* @__PURE__ */ jsx(SlidersHorizontal, { className: "h-4 w-4 shrink-0 text-muted-foreground" }) }) }),
13773
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(BaseInput, { "aria-label": copy.settings, className: "w-auto cursor-pointer px-3", bordered, children: /* @__PURE__ */ jsx(SlidersHorizontal, { className: "h-4 w-4 shrink-0 text-muted-foreground" }) }) }),
13749
13774
  /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-56 bg-card", children: [
13750
13775
  showViewToggle && hasModes && /* @__PURE__ */ jsxs(Fragment, { children: [
13751
13776
  /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: "flex items-center gap-2", children: [
13752
13777
  /* @__PURE__ */ jsx(Eye, { className: "h-3.5 w-3.5" }),
13753
- "View"
13778
+ copy.view
13754
13779
  ] }),
13755
13780
  /* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: viewMode, onValueChange: (v) => setViewMode(v), children: modeItems.map((item) => /* @__PURE__ */ jsxs(DropdownMenuRadioItem, { value: item.value, "aria-label": item.ariaLabel, children: [
13756
13781
  item.icon,
@@ -13761,7 +13786,7 @@ function TableSettingsMenu() {
13761
13786
  showColumnVisibility && hasColumns && /* @__PURE__ */ jsxs(Fragment, { children: [
13762
13787
  /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: "flex items-center gap-2", children: [
13763
13788
  /* @__PURE__ */ jsx(Columns3, { className: "h-3.5 w-3.5" }),
13764
- "Columns"
13789
+ copy.columns
13765
13790
  ] }),
13766
13791
  columns.map((col) => /* @__PURE__ */ jsx(
13767
13792
  DropdownMenuCheckboxItem,
@@ -14079,7 +14104,7 @@ function NTable(props) {
14079
14104
  showColumnVisibility: props.showColumnVisibility ?? false,
14080
14105
  showAddButton: props.showAddButton ?? Boolean(props.onCreate),
14081
14106
  showViewToggle: props.showViewToggle ?? true,
14082
- toolbarLabels: props.toolbarLabels ?? true,
14107
+ toolbarLabels: props.toolbarLabels ?? {},
14083
14108
  dynamicHeight: props.dynamicHeight ?? true,
14084
14109
  noResultsText: props.noResultsText ?? "No results.",
14085
14110
  noDataText: props.noDataText ?? "No data available",
package/dist/json.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import React__default from 'react';
3
- export { N as NTableJson } from './NTableJson-tXqgfZI1.js';
2
+ export { N as NTableJson } from './NTableJson-BHXwRVvL.js';
4
3
 
5
4
  interface JsonViewColors {
6
5
  toolName: string;
@@ -19,7 +18,7 @@ interface JsonViewerProps {
19
18
  className?: string;
20
19
  maxHeight?: string;
21
20
  }
22
- declare function JsonViewer({ value, colors, className, maxHeight }: JsonViewerProps): react_jsx_runtime.JSX.Element;
21
+ declare function JsonViewer({ value, colors, className, maxHeight }: JsonViewerProps): React__default.JSX.Element;
23
22
 
24
23
  interface JsonEditorProps {
25
24
  value: string;
@@ -49,6 +48,6 @@ interface JsonEditorProps {
49
48
  highlightDuplicateStrings?: boolean;
50
49
  highlightStatusStrings?: boolean;
51
50
  }
52
- declare function JsonEditor({ value, onChange, onSave, onReset, onCancel, dirty, parseError, saveError, saveSuccess, loading, saving, colors, lineCount, itemCount, itemLabel, loadingLabel, readOnly, smartPasteLabel, onSmartPaste, onCopy, copyLabel, headerMiddle, statusAddon, showActions, highlightDuplicateStrings, highlightStatusStrings, }: JsonEditorProps): react_jsx_runtime.JSX.Element;
51
+ declare function JsonEditor({ value, onChange, onSave, onReset, onCancel, dirty, parseError, saveError, saveSuccess, loading, saving, colors, lineCount, itemCount, itemLabel, loadingLabel, readOnly, smartPasteLabel, onSmartPaste, onCopy, copyLabel, headerMiddle, statusAddon, showActions, highlightDuplicateStrings, highlightStatusStrings, }: JsonEditorProps): React__default.JSX.Element;
53
52
 
54
53
  export { JsonEditor, type JsonEditorProps, type JsonViewColors, JsonViewer, type JsonViewerProps };
package/dist/theme.css CHANGED
@@ -317,10 +317,10 @@ input:autofill {
317
317
  overflow-x: auto;
318
318
  scrollbar-width: none;
319
319
  }
320
- .najm-overlay-scroll-x::-webkit-scrollbar {
321
- display: none;
322
- }
323
-
320
+ .najm-overlay-scroll-x::-webkit-scrollbar {
321
+ display: none;
322
+ }
323
+
324
324
  /* Responsive table actions stay discoverable on touch and tablet layouts.
325
325
  Fine-pointer desktops may keep the quieter hover/focus reveal treatment. */
326
326
  .ntable-card-action {
@@ -377,7 +377,7 @@ input:autofill {
377
377
  .nimage-input-compact-overlay:focus-visible {
378
378
  opacity: 1;
379
379
  }
380
- }
380
+ }
381
381
 
382
382
  /* OverlayScrollbars theme used by the <NajmScroll> component — a thin,
383
383
  translucent slate bar that floats over content with no reserved space.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najm-kit",
3
- "version": "2.11.11",
3
+ "version": "2.11.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Reusable React UI component package for Najm framework",
@@ -146,6 +146,7 @@
146
146
  "@radix-ui/react-checkbox": "^1",
147
147
  "@radix-ui/react-collapsible": "^1",
148
148
  "@radix-ui/react-dialog": "^1",
149
+ "@radix-ui/react-direction": "^1",
149
150
  "@radix-ui/react-dropdown-menu": "^2",
150
151
  "@radix-ui/react-label": "^2",
151
152
  "@radix-ui/react-popover": "^1",
@@ -197,7 +198,7 @@
197
198
  "@uiw/react-codemirror": "^4.25.0",
198
199
  "@vitejs/plugin-react": "^5.2.0",
199
200
  "happy-dom": "^20.11.1",
200
- "najm-i18n": "^2.0.3",
201
+ "najm-i18n": "^2.1.0",
201
202
  "postcss": "^8.5.22",
202
203
  "react-hook-form": "^7",
203
204
  "rimraf": "^6",
@@ -1,5 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- declare function NTableJson(): react_jsx_runtime.JSX.Element;
4
-
5
- export { NTableJson as N };