@yuno-payments/dashboard-design-system 2.0.4 → 2.0.6

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.
Files changed (43) hide show
  1. package/dist/components/atoms/filter/filter-date-range.d.ts +31 -1
  2. package/dist/components/atoms/filter/filter-date-range.js +139 -143
  3. package/dist/components/atoms/filter/filter-multi-input.d.ts +11 -0
  4. package/dist/components/atoms/filter/filter-multi-input.js +42 -36
  5. package/dist/components/atoms/filter/filter-translations.d.ts +75 -0
  6. package/dist/components/atoms/filter/filter-translations.js +450 -0
  7. package/dist/components/atoms/filter/filter.d.ts +30 -0
  8. package/dist/components/atoms/filter/filter.js +191 -171
  9. package/dist/components/atoms/filter/index.d.ts +2 -2
  10. package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +17 -2
  11. package/dist/components/atoms/filter-dropdown/filter-dropdown.js +160 -151
  12. package/dist/components/atoms/icon/directional-icons.d.ts +12 -0
  13. package/dist/components/atoms/icon/directional-icons.js +38 -0
  14. package/dist/components/atoms/icon/icon.d.ts +6 -0
  15. package/dist/components/atoms/icon/icon.js +27 -21
  16. package/dist/components/atoms/icon/index.d.ts +1 -0
  17. package/dist/components/atoms/index.d.ts +1 -1
  18. package/dist/components/atoms/radio-group/radio-group-option.js +7 -7
  19. package/dist/components/atoms/select/select.js +2 -2
  20. package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.d.ts +3 -1
  21. package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +28 -27
  22. package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +44 -41
  23. package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.d.ts +3 -1
  24. package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.js +45 -44
  25. package/dist/components/organisms/data-table/data-table.d.ts +27 -2
  26. package/dist/components/organisms/data-table/data-table.js +146 -134
  27. package/dist/components/organisms/data-table/data-table.types.d.ts +68 -0
  28. package/dist/components/organisms/data-table/data-table.types.js +252 -0
  29. package/dist/components/organisms/data-table/index.d.ts +2 -1
  30. package/dist/components/organisms/data-table/utils/data-table-utils.js +11 -8
  31. package/dist/dashboard-design-system.css +1 -1
  32. package/dist/index.css +1 -1
  33. package/dist/index.d.ts +2 -1
  34. package/dist/index.esm.min.js +9244 -8451
  35. package/dist/index.js +208 -202
  36. package/dist/index.umd.min.js +19 -19
  37. package/dist/lib/utils.d.ts +13 -0
  38. package/dist/lib/utils.js +34 -10
  39. package/dist/vendor/shadcn/pagination.js +27 -28
  40. package/dist/vendor/shadcn/select.js +33 -33
  41. package/dist/vendor/shadcn/switch.js +1 -1
  42. package/package.json +4 -2
  43. package/registry/components-registry.json +16 -2
@@ -1,10 +1,11 @@
1
- import { j as s } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as p } from "react";
3
- import { cva as u } from "../../../node_modules/class-variance-authority/dist/index.js";
4
- import { cn as x } from "../../../lib/utils.js";
5
- import { IconList as z } from "./icon-list.js";
6
- import { Tooltip as d } from "../tooltip/tooltip.js";
7
- const j = u("inline-flex items-center justify-center shrink-0", {
1
+ import { j as t } from "../../../_virtual/jsx-runtime.js";
2
+ import { forwardRef as d } from "react";
3
+ import { cva as z } from "../../../node_modules/class-variance-authority/dist/index.js";
4
+ import { cn as I } from "../../../lib/utils.js";
5
+ import { IconList as h } from "./icon-list.js";
6
+ import { Tooltip as j } from "../tooltip/tooltip.js";
7
+ import { DIRECTIONAL_ICONS as C } from "./directional-icons.js";
8
+ const N = z("inline-flex items-center justify-center shrink-0", {
8
9
  variants: {
9
10
  size: {
10
11
  xs: "size-3",
@@ -17,34 +18,39 @@ const j = u("inline-flex items-center justify-center shrink-0", {
17
18
  defaultVariants: {
18
19
  size: "md"
19
20
  }
20
- }), g = p(
21
+ }), g = d(
21
22
  ({
22
23
  name: r,
23
- weight: t = "light",
24
+ weight: n = "light",
24
25
  size: e,
25
26
  className: c,
26
27
  color: l,
27
- tooltip: i,
28
+ tooltip: o,
28
29
  tooltipProps: m,
29
- ...a
30
- }, f) => {
30
+ autoMirrorRtl: a,
31
+ ...f
32
+ }, u) => {
31
33
  if (!r)
32
34
  return null;
33
- const o = z?.[r];
34
- if (!o)
35
+ const i = h?.[r];
36
+ if (!i)
35
37
  return console.error("Missing icon", r), null;
36
- const n = /* @__PURE__ */ s.jsx(
37
- o,
38
+ const p = C.has(r), x = a ?? p, s = /* @__PURE__ */ t.jsx(
39
+ i,
38
40
  {
39
- ref: f,
41
+ ref: u,
40
42
  "aria-label": r,
41
- className: x(j({ size: e }), c),
43
+ className: I(
44
+ N({ size: e }),
45
+ x && "rtl:scale-x-[-1]",
46
+ c
47
+ ),
42
48
  color: l || "currentColor",
43
- weight: t,
44
- ...a
49
+ weight: n,
50
+ ...f
45
51
  }
46
52
  );
47
- return i ? /* @__PURE__ */ s.jsx(d, { content: i, ...m, children: n }) : n;
53
+ return o ? /* @__PURE__ */ t.jsx(j, { content: o, ...m, children: s }) : s;
48
54
  }
49
55
  );
50
56
  g.displayName = "Icon";
@@ -1,2 +1,3 @@
1
1
  export { Icon, type IconProps } from './icon';
2
2
  export { IconList, type IconName } from './icon-list';
3
+ export { DIRECTIONAL_ICONS } from './directional-icons';
@@ -10,7 +10,7 @@ export { CurrencyField, type CurrencyFieldProps } from './currency-field';
10
10
  export { DatePicker, type DatePickerProps } from './date-picker';
11
11
  export { DateRangePicker, type DateRangePickerProps, } from './date-range-picker';
12
12
  export { TimePicker, type TimePickerProps } from './time-picker';
13
- export { FilterButton, FilterTag, FilterSection, FilterCheckboxOption, FilterRadioOption, FilterContent, FilterDateRange, FilterDateRangeOption, FilterDateRangeValue, FilterMultiInput, type FilterButtonProps, type FilterTagProps, type FilterSectionProps, type FilterCheckboxOptionProps, type FilterRadioOptionProps, type FilterContentProps, type FilterDateRangeProps, type FilterDateRangeOptionProps, type FilterMultiInputProps, } from './filter';
13
+ export { FilterButton, FilterTag, FilterSection, FilterCheckboxOption, FilterRadioOption, FilterContent, FilterDateRange, FilterDateRangeOption, FilterDateRangeValue, FilterMultiInput, type FilterButtonProps, type FilterTagProps, type FilterSectionProps, type FilterCheckboxOptionProps, type FilterRadioOptionProps, type FilterContentProps, type FilterDateRangeProps, type FilterDateRangeOptionProps, type FilterDateRangeLabels, type FilterMultiInputProps, } from './filter';
14
14
  export { FilterDropdown, FilterMenu, FilterMenuItem, type FilterDropdownProps, type FilterConfig, type FilterMenuProps, type FilterMenuItemProps, type FilterDeferredContext, } from './filter-dropdown';
15
15
  export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, type DropdownMenuProps, type DropdownMenuPortalProps, type DropdownMenuTriggerProps, type DropdownMenuContentProps, type DropdownMenuGroupProps, type DropdownMenuLabelProps, type DropdownMenuItemProps, type DropdownMenuCheckboxItemProps, type DropdownMenuRadioGroupProps, type DropdownMenuRadioItemProps, type DropdownMenuSeparatorProps, type DropdownMenuShortcutProps, type DropdownMenuSubProps, type DropdownMenuSubTriggerProps, type DropdownMenuSubContentProps, } from './dropdown-menu';
16
16
  export { DotsMenu, type DotsMenuProps, type DotsMenuAction, type DotsMenuOptions, } from './dots-menu';
@@ -1,7 +1,7 @@
1
1
  import { j as r } from "../../../_virtual/jsx-runtime.js";
2
2
  import { RadioGroupItem as d } from "../../../vendor/shadcn/radio-group.js";
3
- import { cn as l } from "../../../lib/utils.js";
4
- import { Label as a } from "../label/label.js";
3
+ import { cn as a } from "../../../lib/utils.js";
4
+ import { Label as l } from "../label/label.js";
5
5
  const o = ({
6
6
  option: e,
7
7
  radioId: s,
@@ -22,23 +22,23 @@ const o = ({
22
22
  ),
23
23
  t ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
24
24
  /* @__PURE__ */ r.jsx(
25
- a,
25
+ l,
26
26
  {
27
27
  htmlFor: s,
28
- className: l(
28
+ className: a(
29
29
  "cursor-pointer",
30
30
  e.disabled && "text-muted-foreground"
31
31
  ),
32
32
  children: e.label
33
33
  }
34
34
  ),
35
- e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground ml-auto", children: e.description })
35
+ e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground ms-auto", children: e.description })
36
36
  ] }) : /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-1.5 flex-1", children: [
37
37
  /* @__PURE__ */ r.jsx(
38
- a,
38
+ l,
39
39
  {
40
40
  htmlFor: s,
41
- className: l(
41
+ className: a(
42
42
  "cursor-pointer",
43
43
  e.disabled && "text-muted-foreground"
44
44
  ),
@@ -72,14 +72,14 @@ const $ = G.forwardRef(
72
72
  j.map((l, C) => /* @__PURE__ */ e.jsxs(V, { children: [
73
73
  l.label && /* @__PURE__ */ e.jsx(E, { children: l.label }),
74
74
  l.options.map((s) => /* @__PURE__ */ e.jsxs(f, { value: s.value, children: [
75
- s.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: s.icon }),
75
+ s.icon && /* @__PURE__ */ e.jsx("span", { className: "me-2 inline-flex items-center", children: s.icon }),
76
76
  s.label
77
77
  ] }, s.value))
78
78
  ] }, C))
79
79
  ) : w ? (
80
80
  // Render flat options
81
81
  h.map((l) => /* @__PURE__ */ e.jsx(f, { value: l.value, children: /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
82
- l.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: l.icon }),
82
+ l.icon && /* @__PURE__ */ e.jsx("span", { className: "me-2 inline-flex items-center", children: l.icon }),
83
83
  l.label
84
84
  ] }) }, l.value))
85
85
  ) : null })
@@ -1,8 +1,10 @@
1
1
  import { Column } from '@tanstack/react-table';
2
+ import { DataTableTranslations } from '../../data-table.types';
2
3
  interface DataTableColumnHeaderMenuProps<TData, TValue> {
3
4
  column: Column<TData, TValue>;
4
5
  isLastVisibleColumn: boolean;
5
6
  onManageColumnsClick: () => void;
7
+ translations: Required<DataTableTranslations>;
6
8
  }
7
- export declare function DataTableColumnHeaderMenu<TData, TValue>({ column, isLastVisibleColumn, onManageColumnsClick, }: DataTableColumnHeaderMenuProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
9
+ export declare function DataTableColumnHeaderMenu<TData, TValue>({ column, isLastVisibleColumn, onManageColumnsClick, translations, }: DataTableColumnHeaderMenuProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
8
10
  export {};
@@ -1,75 +1,76 @@
1
1
  import { j as e } from "../../../../../_virtual/jsx-runtime.js";
2
2
  import { Icon as n } from "../../../../atoms/icon/icon.js";
3
- import { DropdownMenuContent as g, DropdownMenuItem as i, DropdownMenuSeparator as o } from "../../../../atoms/dropdown-menu/dropdown-menu.js";
4
- function p({
3
+ import { DropdownMenuContent as c, DropdownMenuItem as r, DropdownMenuSeparator as o } from "../../../../atoms/dropdown-menu/dropdown-menu.js";
4
+ function C({
5
5
  column: s,
6
- isLastVisibleColumn: r,
7
- onManageColumnsClick: a
6
+ isLastVisibleColumn: d,
7
+ onManageColumnsClick: x,
8
+ translations: i
8
9
  }) {
9
- const l = s.getCanSort(), d = s.getCanPin(), x = s.getCanHide(), t = s.getIsPinned(), c = s.getIsSorted();
10
- return /* @__PURE__ */ e.jsxs(g, { align: "start", children: [
10
+ const l = s.getCanSort(), a = s.getCanPin(), g = s.getCanHide(), t = s.getIsPinned(), m = s.getIsSorted();
11
+ return /* @__PURE__ */ e.jsxs(c, { align: "start", children: [
11
12
  l && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
12
- /* @__PURE__ */ e.jsxs(i, { onClick: () => s.toggleSorting(!1), children: [
13
+ /* @__PURE__ */ e.jsxs(r, { onClick: () => s.toggleSorting(!1), children: [
13
14
  /* @__PURE__ */ e.jsx(n, { name: "ArrowUp", size: "sm" }),
14
- "Ascending"
15
+ i.ascending
15
16
  ] }),
16
- /* @__PURE__ */ e.jsxs(i, { onClick: () => s.toggleSorting(!0), children: [
17
+ /* @__PURE__ */ e.jsxs(r, { onClick: () => s.toggleSorting(!0), children: [
17
18
  /* @__PURE__ */ e.jsx(n, { name: "ArrowDown", size: "sm" }),
18
- "Descending"
19
+ i.descending
19
20
  ] }),
20
- c && /* @__PURE__ */ e.jsxs(i, { onClick: () => s.clearSorting(), children: [
21
+ m && /* @__PURE__ */ e.jsxs(r, { onClick: () => s.clearSorting(), children: [
21
22
  /* @__PURE__ */ e.jsx(n, { name: "X", size: "sm" }),
22
- "Clear sorting"
23
+ i.clearSorting
23
24
  ] }),
24
25
  /* @__PURE__ */ e.jsx(o, {})
25
26
  ] }),
26
- d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
27
+ a && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
27
28
  /* @__PURE__ */ e.jsxs(
28
- i,
29
+ r,
29
30
  {
30
31
  onClick: () => s.pin("left"),
31
32
  disabled: t === "left",
32
33
  children: [
33
34
  /* @__PURE__ */ e.jsx(n, { name: "PushPinSimple", size: "sm" }),
34
- "Pin to the left"
35
+ i.pinToLeft
35
36
  ]
36
37
  }
37
38
  ),
38
39
  /* @__PURE__ */ e.jsxs(
39
- i,
40
+ r,
40
41
  {
41
42
  onClick: () => s.pin("right"),
42
43
  disabled: t === "right",
43
44
  children: [
44
45
  /* @__PURE__ */ e.jsx(n, { name: "PushPinSimple", size: "sm" }),
45
- "Pin to the right"
46
+ i.pinToRight
46
47
  ]
47
48
  }
48
49
  ),
49
- t && /* @__PURE__ */ e.jsxs(i, { onClick: () => s.pin(!1), children: [
50
+ t && /* @__PURE__ */ e.jsxs(r, { onClick: () => s.pin(!1), children: [
50
51
  /* @__PURE__ */ e.jsx(n, { name: "PushPinSimpleSlash", size: "sm" }),
51
- "Unpin"
52
+ i.unpin
52
53
  ] }),
53
54
  /* @__PURE__ */ e.jsx(o, {})
54
55
  ] }),
55
- x && /* @__PURE__ */ e.jsxs(
56
- i,
56
+ g && /* @__PURE__ */ e.jsxs(
57
+ r,
57
58
  {
58
59
  onClick: () => s.toggleVisibility(!1),
59
- disabled: r,
60
+ disabled: d,
60
61
  children: [
61
62
  /* @__PURE__ */ e.jsx(n, { name: "EyeSlash", size: "sm" }),
62
- "Hide",
63
- r && /* @__PURE__ */ e.jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: "(Last column)" })
63
+ i.hide,
64
+ d && /* @__PURE__ */ e.jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: i.lastColumn })
64
65
  ]
65
66
  }
66
67
  ),
67
- /* @__PURE__ */ e.jsxs(i, { onClick: a, children: [
68
+ /* @__PURE__ */ e.jsxs(r, { onClick: x, children: [
68
69
  /* @__PURE__ */ e.jsx(n, { name: "Columns", size: "sm" }),
69
- "Manage columns"
70
+ i.manageColumns
70
71
  ] })
71
72
  ] });
72
73
  }
73
74
  export {
74
- p as DataTableColumnHeaderMenu
75
+ C as DataTableColumnHeaderMenu
75
76
  };
@@ -1,37 +1,38 @@
1
1
  import { j as e } from "../../../../../_virtual/jsx-runtime.js";
2
- import { Icon as b } from "../../../../atoms/icon/icon.js";
3
- import { cn as m } from "../../../../../lib/utils.js";
4
- import { useColumnHeader as D } from "../../hooks/use-column-header.js";
5
- import { DataTableColumnHeaderMenu as O } from "./data-table-column-header-menu.js";
2
+ import { Icon as h } from "../../../../atoms/icon/icon.js";
3
+ import { cn as u } from "../../../../../lib/utils.js";
4
+ import { useColumnHeader as O } from "../../hooks/use-column-header.js";
5
+ import { DataTableColumnHeaderMenu as b } from "./data-table-column-header-menu.js";
6
6
  import { DataTableManageColumnsDialog as v } from "../dialogs/data-table-manage-columns-dialog.js";
7
- import { DataTableColumnHeaderContent as H } from "./data-table-column-header-content.js";
7
+ import { DataTableColumnHeaderContent as A } from "./data-table-column-header-content.js";
8
+ import { DEFAULT_DATA_TABLE_TRANSLATIONS as H } from "../../data-table.types.js";
8
9
  import { DropdownMenu as I } from "../../../../atoms/dropdown-menu/dropdown-menu.js";
9
- function z({
10
+ function w({
10
11
  column: o,
11
- table: l,
12
- title: s,
13
- className: a,
12
+ table: s,
13
+ title: a,
14
+ className: r,
14
15
  info: n
15
16
  }) {
16
17
  const {
17
- isHovered: u,
18
- setIsHovered: r,
19
- isMenuOpen: t,
20
- setIsMenuOpen: p,
21
- isManageColumnsOpen: d,
18
+ isHovered: p,
19
+ setIsHovered: t,
20
+ isMenuOpen: i,
21
+ setIsMenuOpen: d,
22
+ isManageColumnsOpen: c,
22
23
  setIsManageColumnsOpen: C,
23
- isPinned: c,
24
- canPin: x,
25
- canSort: i,
24
+ isPinned: x,
25
+ canPin: f,
26
+ canSort: m,
26
27
  isSorted: g,
27
- toggleableColumns: f,
28
- visibleColumnsCount: j,
29
- isLastVisibleColumn: M,
30
- handleManageColumnsClick: h
31
- } = D(o, l);
32
- return !i && !x ? /* @__PURE__ */ e.jsxs("div", { className: m("flex items-center gap-2", a), children: [
28
+ toggleableColumns: j,
29
+ visibleColumnsCount: M,
30
+ isLastVisibleColumn: D,
31
+ handleManageColumnsClick: T
32
+ } = O(o, s), l = s.options.meta?.translations ?? H;
33
+ return !m && !f ? /* @__PURE__ */ e.jsxs("div", { className: u("flex items-center gap-2", r), children: [
33
34
  n && /* @__PURE__ */ e.jsx(
34
- b,
35
+ h,
35
36
  {
36
37
  name: "Info",
37
38
  size: "sm",
@@ -39,43 +40,45 @@ function z({
39
40
  tooltip: n
40
41
  }
41
42
  ),
42
- /* @__PURE__ */ e.jsx("span", { children: s })
43
+ /* @__PURE__ */ e.jsx("span", { children: a })
43
44
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
44
- /* @__PURE__ */ e.jsx("div", { className: m("flex items-center gap-2", a), children: /* @__PURE__ */ e.jsxs(I, { open: t, onOpenChange: p, children: [
45
+ /* @__PURE__ */ e.jsx("div", { className: u("flex items-center gap-2", r), children: /* @__PURE__ */ e.jsxs(I, { open: i, onOpenChange: d, children: [
45
46
  /* @__PURE__ */ e.jsx(
46
- H,
47
+ A,
47
48
  {
48
- title: s,
49
+ title: a,
49
50
  info: n,
50
- isPinned: c,
51
- canSort: i,
51
+ isPinned: x,
52
+ canSort: m,
52
53
  sortDirection: g,
53
- isHovered: u,
54
- isMenuOpen: t,
55
- onMouseEnter: () => r(!0),
56
- onMouseLeave: () => r(!1)
54
+ isHovered: p,
55
+ isMenuOpen: i,
56
+ onMouseEnter: () => t(!0),
57
+ onMouseLeave: () => t(!1)
57
58
  }
58
59
  ),
59
60
  /* @__PURE__ */ e.jsx(
60
- O,
61
+ b,
61
62
  {
62
63
  column: o,
63
- isLastVisibleColumn: M,
64
- onManageColumnsClick: h
64
+ isLastVisibleColumn: D,
65
+ onManageColumnsClick: T,
66
+ translations: l
65
67
  }
66
68
  )
67
69
  ] }) }),
68
70
  /* @__PURE__ */ e.jsx(
69
71
  v,
70
72
  {
71
- isOpen: d,
73
+ isOpen: c,
72
74
  onOpenChange: C,
73
- toggleableColumns: f,
74
- visibleColumnsCount: j
75
+ toggleableColumns: j,
76
+ visibleColumnsCount: M,
77
+ translations: l
75
78
  }
76
79
  )
77
80
  ] });
78
81
  }
79
82
  export {
80
- z as DataTableColumnHeader
83
+ w as DataTableColumnHeader
81
84
  };
@@ -1,9 +1,11 @@
1
1
  import { Column } from '@tanstack/react-table';
2
+ import { DataTableTranslations } from '../../data-table.types';
2
3
  interface DataTableManageColumnsDialogProps<TData> {
3
4
  isOpen: boolean;
4
5
  onOpenChange: (open: boolean) => void;
5
6
  toggleableColumns: Column<TData, unknown>[];
6
7
  visibleColumnsCount: number;
8
+ translations: Required<DataTableTranslations>;
7
9
  }
8
- export declare function DataTableManageColumnsDialog<TData>({ isOpen, onOpenChange, toggleableColumns, visibleColumnsCount, }: DataTableManageColumnsDialogProps<TData>): import("react/jsx-runtime").JSX.Element;
10
+ export declare function DataTableManageColumnsDialog<TData>({ isOpen, onOpenChange, toggleableColumns, visibleColumnsCount, translations, }: DataTableManageColumnsDialogProps<TData>): import("react/jsx-runtime").JSX.Element;
9
11
  export {};
@@ -1,68 +1,69 @@
1
- import { j as s } from "../../../../../_virtual/jsx-runtime.js";
2
- import { useState as x } from "react";
3
- import { getColumnDisplayName as c } from "../../utils/data-table-utils.js";
4
- import { Dialog as y } from "../../../dialog/dialog.js";
5
- import { SearchField as N } from "../../../../atoms/search-field/search-field.js";
6
- import { Switch as V } from "../../../../atoms/switch/switch.js";
1
+ import { j as l } from "../../../../../_virtual/jsx-runtime.js";
2
+ import { useState as y } from "react";
3
+ import { getColumnDisplayName as d } from "../../utils/data-table-utils.js";
4
+ import { Dialog as C } from "../../../dialog/dialog.js";
5
+ import { SearchField as V } from "../../../../atoms/search-field/search-field.js";
6
+ import { Switch as j } from "../../../../atoms/switch/switch.js";
7
7
  function D({
8
- isOpen: d,
9
- onOpenChange: m,
10
- toggleableColumns: l,
11
- visibleColumnsCount: t
8
+ isOpen: m,
9
+ onOpenChange: h,
10
+ toggleableColumns: t,
11
+ visibleColumnsCount: a,
12
+ translations: i
12
13
  }) {
13
- const [a, n] = x(""), h = () => {
14
- n(""), m(!1);
15
- }, o = l.filter((e) => c(e).toLowerCase().includes(a.toLowerCase())), u = () => {
16
- l.forEach((e) => e.toggleVisibility(!0));
17
- }, p = () => {
18
- const e = l.filter(
19
- (i) => i.getIsVisible()
14
+ const [o, r] = y(""), u = () => {
15
+ r(""), h(!1);
16
+ }, n = t.filter((e) => d(e).toLowerCase().includes(o.toLowerCase())), p = () => {
17
+ t.forEach((e) => e.toggleVisibility(!0));
18
+ }, f = () => {
19
+ const e = t.filter(
20
+ (s) => s.getIsVisible()
20
21
  );
21
- e.length <= 1 || e.slice(1).forEach((i) => i.toggleVisibility(!1));
22
- }, f = l.every(
22
+ e.length <= 1 || e.slice(1).forEach((s) => s.toggleVisibility(!1));
23
+ }, b = t.every(
23
24
  (e) => e.getIsVisible()
24
- ), b = t <= 1;
25
- return /* @__PURE__ */ s.jsx(
26
- y,
25
+ ), g = a <= 1;
26
+ return /* @__PURE__ */ l.jsx(
27
+ C,
27
28
  {
28
- open: d,
29
- closeIcon: h,
30
- title: "Manage columns",
29
+ open: m,
30
+ closeIcon: u,
31
+ title: i.manageColumns,
31
32
  widthContainer: 400,
32
33
  buttons: [
33
34
  {
34
- children: "Hide all",
35
+ children: i.hideAll,
35
36
  variant: "link",
36
- onClick: p,
37
- disabled: b
37
+ onClick: f,
38
+ disabled: g
38
39
  },
39
40
  {
40
- children: "Show all",
41
+ children: i.showAll,
41
42
  variant: "link",
42
- onClick: u,
43
- disabled: f
43
+ onClick: p,
44
+ disabled: b
44
45
  }
45
46
  ],
46
- children: /* @__PURE__ */ s.jsxs("div", { className: "space-y-4", children: [
47
- /* @__PURE__ */ s.jsx(
48
- N,
47
+ children: /* @__PURE__ */ l.jsxs("div", { className: "space-y-4", children: [
48
+ /* @__PURE__ */ l.jsx(
49
+ V,
49
50
  {
50
- placeholder: "Search columns...",
51
- value: a,
52
- onSearch: n,
51
+ placeholder: i.searchColumns,
52
+ value: o,
53
+ onSearch: r,
53
54
  className: "mb-6"
54
55
  }
55
56
  ),
56
- /* @__PURE__ */ s.jsx("div", { className: "space-y-4 max-h-[300px] overflow-y-auto", children: o.length === 0 ? /* @__PURE__ */ s.jsx("p", { className: "text-sm text-muted-foreground text-center py-4", children: "No columns found" }) : o.map((e) => {
57
- const i = c(e), r = t === 1 && e.getIsVisible();
58
- return /* @__PURE__ */ s.jsx(
59
- V,
57
+ /* @__PURE__ */ l.jsx("div", { className: "space-y-4 max-h-[300px] overflow-y-auto", children: n.length === 0 ? /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground text-center py-4", children: i.noColumnsFound }) : n.map((e) => {
58
+ const s = d(e), c = a === 1 && e.getIsVisible();
59
+ return /* @__PURE__ */ l.jsx(
60
+ j,
60
61
  {
61
62
  id: `column-${e.id}`,
62
63
  checked: e.getIsVisible(),
63
- disabled: r,
64
- label: `${i}${r ? " (Last column)" : ""}`,
65
- onChange: (g) => e.toggleVisibility(g.target.checked)
64
+ disabled: c,
65
+ label: `${s}${c ? ` ${i.lastColumn}` : ""}`,
66
+ onChange: (x) => e.toggleVisibility(x.target.checked)
66
67
  },
67
68
  e.id
68
69
  );
@@ -1,5 +1,5 @@
1
1
  import { ColumnResizeMode } from '@tanstack/react-table';
2
- import { DataTableActionsConfig, DataTableColumnDef } from './data-table.types';
2
+ import { DataTableActionsConfig, DataTableColumnDef, DataTableTranslations, DataTableLanguage } from './data-table.types';
3
3
  import { EmptyProps } from '../../molecules';
4
4
  /**
5
5
  * Props for the DataTable component
@@ -117,6 +117,31 @@ export interface DataTableProps<TData, TValue> {
117
117
  * @default false
118
118
  */
119
119
  enableColumnDragDrop?: boolean;
120
+ /**
121
+ * Language code for translations.
122
+ * When provided, uses built-in translations for the specified language.
123
+ * @default "en"
124
+ */
125
+ lang?: DataTableLanguage;
126
+ /**
127
+ * Translation strings for the column menu and dialogs.
128
+ * All fields are optional with English defaults.
129
+ * Overrides lang-based translations if both are provided.
130
+ *
131
+ * @example
132
+ * ```tsx
133
+ * <DataTable
134
+ * lang="es"
135
+ * translations={{
136
+ * ascending: t('table.ascending'),
137
+ * descending: t('table.descending'),
138
+ * clearSorting: t('table.clearSorting'),
139
+ * // ...
140
+ * }}
141
+ * />
142
+ * ```
143
+ */
144
+ translations?: DataTableTranslations;
120
145
  }
121
146
  /**
122
147
  * Advanced data table component built on TanStack Table.
@@ -134,4 +159,4 @@ export interface DataTableProps<TData, TValue> {
134
159
  * />
135
160
  * ```
136
161
  */
137
- export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, rowSelection: externalRowSelection, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, enableColumnPinning, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, enableColumnDragDrop, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
162
+ export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, rowSelection: externalRowSelection, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, enableColumnPinning, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, enableColumnDragDrop, lang, translations, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;