@ztwoint/z-ui 0.1.45 → 0.1.47

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 (102) hide show
  1. package/dist/components/assets/icons/check.d.ts +8 -0
  2. package/dist/components/assets/icons/check.js +17 -0
  3. package/dist/components/assets/icons/x-mark.d.ts +8 -0
  4. package/dist/components/assets/icons/x-mark.js +17 -0
  5. package/dist/components/table/components/cell/avatar-cell.d.ts +15 -0
  6. package/dist/components/table/components/cell/avatar-cell.js +74 -0
  7. package/dist/components/table/components/cell/boolean-cell.d.ts +1 -2
  8. package/dist/components/table/components/cell/boolean-cell.js +5 -5
  9. package/dist/components/table/components/cell/description-cell.d.ts +7 -0
  10. package/dist/components/table/components/cell/description-cell.js +16 -0
  11. package/dist/components/table/components/cell/index.d.ts +10 -1
  12. package/dist/components/table/components/cell/label-cell.d.ts +10 -0
  13. package/dist/components/table/components/cell/label-cell.js +47 -0
  14. package/dist/components/table/components/cell/link-cell.d.ts +10 -0
  15. package/dist/components/table/components/cell/link-cell.js +35 -0
  16. package/dist/components/table/components/cell/number-cell.d.ts +5 -3
  17. package/dist/components/table/components/cell/number-cell.js +40 -3
  18. package/dist/components/table/components/index.d.ts +1 -1
  19. package/dist/components/table/components/pagination/index.d.ts +1 -0
  20. package/dist/components/table/components/pagination/pagination.hook.d.ts +1 -1
  21. package/dist/components/table/components/pagination/pagination.hook.js +20 -16
  22. package/dist/components/table/components/table-cell.d.ts +1 -1
  23. package/dist/components/table/components/table-cell.js +41 -32
  24. package/dist/components/table/components/table-filter/filters/boolean.js +52 -44
  25. package/dist/components/table/components/table-filter/filters/checkbox.js +35 -51
  26. package/dist/components/table/components/table-filter/filters/text.js +41 -39
  27. package/dist/components/table/components/table-filter/index.d.ts +4 -1
  28. package/dist/components/table/components/table-filter/selected-filters-display/index.d.ts +2 -0
  29. package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.d.ts +3 -0
  30. package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.js +30 -0
  31. package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +12 -0
  32. package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts +6 -0
  33. package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +26 -0
  34. package/dist/components/table/components/table-filter/table-filter-button.d.ts +2 -0
  35. package/dist/components/table/components/table-filter/table-filter-button.js +113 -0
  36. package/dist/components/table/components/table-filter/table-filter-column-button.d.ts +3 -0
  37. package/dist/components/table/components/table-filter/table-filter-column-button.js +79 -0
  38. package/dist/components/table/components/table-filter/table-filter-column-button.type.d.ts +3 -0
  39. package/dist/components/table/components/table-filter/table-filter-provider.d.ts +14 -0
  40. package/dist/components/table/components/table-filter/table-filter-provider.js +32 -0
  41. package/dist/components/table/components/table-filter/table-filter.context.d.ts +21 -0
  42. package/dist/components/table/components/table-filter/table-filter.context.js +13 -0
  43. package/dist/components/table/components/table-filter/table-filter.hook.d.ts +1 -2
  44. package/dist/components/table/components/table-filter/table-filter.hook.js +39 -37
  45. package/dist/components/table/components/table-header/stories/basic-header.d.ts +1 -1
  46. package/dist/components/table/components/table-header/table-header.js +10 -10
  47. package/dist/components/table/index.d.ts +2 -3
  48. package/dist/components/table/table-provider.d.ts +1 -1
  49. package/dist/components/table/table-provider.js +50 -21
  50. package/dist/components/table/table.const.d.ts +10 -8
  51. package/dist/components/table/table.const.js +10 -8
  52. package/dist/components/table/table.js +1 -7
  53. package/dist/components/table/table.type.d.ts +37 -4
  54. package/dist/components/table/table.utils.d.ts +1 -2
  55. package/dist/components/table/table.utils.js +7 -3
  56. package/dist/components/table-card/table-card.js +113 -81
  57. package/dist/components/table-card/table-card.type.d.ts +7 -7
  58. package/dist/css/styles/tailwind.css +1 -1
  59. package/dist/hooks/useClickOutside.d.ts +1 -0
  60. package/dist/hooks/useClickOutside.js +14 -0
  61. package/dist/index.js +106 -111
  62. package/dist/types/components/assets/icons/check.d.ts +8 -0
  63. package/dist/types/components/assets/icons/x-mark.d.ts +8 -0
  64. package/dist/types/components/table/components/cell/avatar-cell.d.ts +15 -0
  65. package/dist/types/components/table/components/cell/boolean-cell.d.ts +1 -2
  66. package/dist/types/components/table/components/cell/description-cell.d.ts +7 -0
  67. package/dist/types/components/table/components/cell/index.d.ts +10 -1
  68. package/dist/types/components/table/components/cell/label-cell.d.ts +10 -0
  69. package/dist/types/components/table/components/cell/link-cell.d.ts +10 -0
  70. package/dist/types/components/table/components/cell/number-cell.d.ts +5 -3
  71. package/dist/types/components/table/components/index.d.ts +1 -1
  72. package/dist/types/components/table/components/pagination/index.d.ts +1 -0
  73. package/dist/types/components/table/components/pagination/pagination.hook.d.ts +1 -1
  74. package/dist/types/components/table/components/table-cell.d.ts +1 -1
  75. package/dist/types/components/table/components/table-filter/index.d.ts +4 -1
  76. package/dist/types/components/table/components/table-filter/selected-filters-display/index.d.ts +2 -0
  77. package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.d.ts +3 -0
  78. package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +12 -0
  79. package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts +6 -0
  80. package/dist/types/components/table/components/table-filter/table-filter-button.d.ts +2 -0
  81. package/dist/types/components/table/components/table-filter/table-filter-column-button.d.ts +3 -0
  82. package/dist/types/components/table/components/table-filter/table-filter-column-button.type.d.ts +3 -0
  83. package/dist/types/components/table/components/table-filter/table-filter-provider.d.ts +14 -0
  84. package/dist/types/components/table/components/table-filter/table-filter.context.d.ts +21 -0
  85. package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +1 -2
  86. package/dist/types/components/table/components/table-header/stories/basic-header.d.ts +1 -1
  87. package/dist/types/components/table/index.d.ts +2 -3
  88. package/dist/types/components/table/table-provider.d.ts +1 -1
  89. package/dist/types/components/table/table.const.d.ts +10 -8
  90. package/dist/types/components/table/table.type.d.ts +37 -4
  91. package/dist/types/components/table/table.utils.d.ts +1 -2
  92. package/dist/types/components/table-card/table-card.type.d.ts +7 -7
  93. package/dist/types/hooks/useClickOutside.d.ts +1 -0
  94. package/package.json +2 -1
  95. package/dist/components/table/components/cell/text-cell.d.ts +0 -7
  96. package/dist/components/table/components/cell/text-cell.js +0 -5
  97. package/dist/components/table/components/table-filter/table-filter.d.ts +0 -9
  98. package/dist/components/table/components/table-filter/table-filter.js +0 -120
  99. package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +0 -26
  100. package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +0 -26
  101. package/dist/types/components/table/components/cell/text-cell.d.ts +0 -7
  102. package/dist/types/components/table/components/table-filter/table-filter.d.ts +0 -9
@@ -0,0 +1,8 @@
1
+ import { SVGProps } from 'react';
2
+ type IconProps = SVGProps<SVGSVGElement> & {
3
+ secondaryfill?: string;
4
+ strokewidth?: number;
5
+ title?: string;
6
+ };
7
+ export declare function Check({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
8
+ export default Check;
@@ -0,0 +1,17 @@
1
+ import { jsxs as e, jsx as l } from "react/jsx-runtime";
2
+ function s({ title: r = "badge 13", ...t }) {
3
+ return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ...t, children: [
4
+ /* @__PURE__ */ l("title", { children: r }),
5
+ /* @__PURE__ */ l("g", { fill: "currentColor", children: /* @__PURE__ */ l(
6
+ "path",
7
+ {
8
+ d: "M16,0C7.163,0,0,7.163,0,16s7.163,16,16,16,16-7.163,16-16C31.974,7.174,24.826,.026,16,0Zm7.707,11.707l-10,10c-.195,.195-.451,.293-.707,.293s-.512-.098-.707-.293l-4-4c-.391-.391-.391-1.023,0-1.414s1.023-.391,1.414,0l3.293,3.293,9.293-9.293c.391-.391,1.023-.391,1.414,0s.391,1.023,0,1.414Z",
9
+ fill: "currentColor"
10
+ }
11
+ ) })
12
+ ] });
13
+ }
14
+ export {
15
+ s as Check,
16
+ s as default
17
+ };
@@ -0,0 +1,8 @@
1
+ import { SVGProps } from 'react';
2
+ type IconProps = SVGProps<SVGSVGElement> & {
3
+ secondaryfill?: string;
4
+ strokewidth?: number;
5
+ title?: string;
6
+ };
7
+ export declare function XMark({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
8
+ export default XMark;
@@ -0,0 +1,17 @@
1
+ import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
+ function i({ title: r = "badge 13", ...t }) {
3
+ return /* @__PURE__ */ s("svg", { height: "48", width: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", ...t, children: [
4
+ /* @__PURE__ */ l("title", { children: r }),
5
+ /* @__PURE__ */ l("g", { fill: "currentColor", children: /* @__PURE__ */ l(
6
+ "path",
7
+ {
8
+ d: "M24,1C11.3,1,1,11.3,1,24s10.3,23,23,23s23-10.3,23-23S36.7,1,24,1z M32.7,31.3c0.4,0.4,0.4,1,0,1.4 C32.5,32.9,32.3,33,32,33s-0.5-0.1-0.7-0.3L24,25.4l-7.3,7.3C16.5,32.9,16.3,33,16,33s-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4 l7.3-7.3l-7.3-7.3c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l7.3,7.3l7.3-7.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4L25.4,24L32.7,31.3z",
9
+ fill: "currentColor"
10
+ }
11
+ ) })
12
+ ] });
13
+ }
14
+ export {
15
+ i as XMark,
16
+ i as default
17
+ };
@@ -0,0 +1,15 @@
1
+ import { FC } from 'react';
2
+ import { RootProps, LabelProps } from '../../../avatar/avatar';
3
+ import { CellValue } from '../../table.type';
4
+ export interface AvatarCellProps {
5
+ avatar: {
6
+ label: LabelProps['label'];
7
+ color: RootProps['color'];
8
+ };
9
+ value: CellValue;
10
+ rightIcon?: React.ReactNode;
11
+ className?: string;
12
+ helperText?: string;
13
+ description?: string;
14
+ }
15
+ export declare const AvatarCell: FC<AvatarCellProps>;
@@ -0,0 +1,74 @@
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ /* empty css */
3
+ import "react";
4
+ import { cn as r } from "../../../../lib/utils.js";
5
+ import "../../../alert/alert.const.js";
6
+ import "../../../button/button.js";
7
+ import "../../../collapsible-side-nav-bar/side-nav-bar-provider.js";
8
+ import "../../../collapsible-side-nav-bar/side-nav-bar.js";
9
+ import "../../../collapsible-side-nav-bar/side-nav-bar-header.js";
10
+ import "../../../collapsible-side-nav-bar/side-nav-bar-content.js";
11
+ import "../../../collapsible-side-nav-bar/side-nav-bar-footer.js";
12
+ import "../../../collapsible-side-nav-bar/side-nav-bar-group.js";
13
+ import "../../../collapsible-side-nav-bar/side-nav-bar-item.js";
14
+ import "../../../collapsible-side-nav-bar/side-nav-bar-separator.js";
15
+ import "../../../collapsible-side-nav-bar/context.js";
16
+ import "../../../collapsible-side-nav-bar/popover/popover.js";
17
+ import "react-country-flag";
18
+ import "classnames";
19
+ import "@radix-ui/react-dialog";
20
+ import "../../../dropdown/z2-dropdown.js";
21
+ import "@radix-ui/react-dropdown-menu";
22
+ import "lucide-react";
23
+ import "../../../input/input.js";
24
+ import "../../../nav-header/nav-header.js";
25
+ import "../../../nav-header/nav-item/nav-item.js";
26
+ import "@radix-ui/react-select";
27
+ import "../../../stepper/stepper.js";
28
+ import "../../../stepper-item/stepper-item.js";
29
+ import "@radix-ui/react-tabs";
30
+ import "../../table-provider.js";
31
+ import { Avatar as p } from "../../../avatar/avatar.js";
32
+ import "../../table.context.js";
33
+ import "../../../tooltip/tooltip.js";
34
+ import "../../../badge/badge.js";
35
+ const V = ({
36
+ avatar: m,
37
+ value: a,
38
+ rightIcon: e,
39
+ className: s,
40
+ helperText: o,
41
+ description: l
42
+ }) => /* @__PURE__ */ i(
43
+ "div",
44
+ {
45
+ className: r(
46
+ "flex flex-col gap-2.5 items-center hover:bg-background-neutral-light h-full min-w-full leading-none-medium-sm p-3",
47
+ s
48
+ ),
49
+ children: [
50
+ /* @__PURE__ */ i(
51
+ "div",
52
+ {
53
+ className: r(
54
+ "text-text-neutral-primary flex justify-between gap-2.5 min-w-full items-center"
55
+ ),
56
+ children: [
57
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2 h-full", children: [
58
+ /* @__PURE__ */ t(p.Root, { size: "xxs", color: m.color, children: /* @__PURE__ */ t(p.Label, { label: m.label }) }),
59
+ a
60
+ ] }),
61
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2.5", children: [
62
+ o && /* @__PURE__ */ t("span", { className: "text-text-neutral-secondary", children: o }),
63
+ e && /* @__PURE__ */ t("span", { className: r("min-h-max min-w-max"), children: e })
64
+ ] })
65
+ ]
66
+ }
67
+ ),
68
+ l && /* @__PURE__ */ t("div", { className: "text-text-neutral-secondary w-full", children: l })
69
+ ]
70
+ }
71
+ );
72
+ export {
73
+ V as AvatarCell
74
+ };
@@ -1,7 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { CellValue } from '../../table.type';
3
- interface BooleanCellProps {
3
+ export interface BooleanCellProps {
4
4
  value: CellValue;
5
5
  }
6
6
  export declare const BooleanCell: FC<BooleanCellProps>;
7
- export {};
@@ -1,7 +1,7 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import o from "../../../../node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js";
3
- import t from "../../../../node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js";
4
- const l = ({ value: r }) => r == null ? null : r ? /* @__PURE__ */ e(o, { className: "text-green-500 w-4 h-4" }) : /* @__PURE__ */ e(t, { className: "text-red-500 w-4 h-4" });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Check as t } from "../../../assets/icons/check.js";
3
+ import { XMark as l } from "../../../assets/icons/x-mark.js";
4
+ const s = ({ value: e }) => e == null ? null : /* @__PURE__ */ r("div", { className: "flex items-center p-3 h-full", children: e ? /* @__PURE__ */ r(t, { className: "text-green-500 w-3.5 h-3.5" }) : /* @__PURE__ */ r(l, { className: "text-red-500 w-3.5 h-3.5" }) });
5
5
  export {
6
- l as BooleanCell
6
+ s as BooleanCell
7
7
  };
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { CellValue } from '../../table.type';
3
+ export interface DescriptionCellProps {
4
+ value: CellValue;
5
+ className?: string;
6
+ }
7
+ export declare const DescriptionCell: FC<DescriptionCellProps>;
@@ -0,0 +1,16 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { cn as l } from "../../../../lib/utils.js";
3
+ const i = ({ value: e, className: t }) => /* @__PURE__ */ r(
4
+ "div",
5
+ {
6
+ className: l(
7
+ "text-text-neutral-secondary p-3 w-full h-full items-center flex hover:bg-background-neutral-light",
8
+ "leading-[24px] text-[14px]",
9
+ t
10
+ ),
11
+ children: e
12
+ }
13
+ );
14
+ export {
15
+ i as DescriptionCell
16
+ };
@@ -1,3 +1,12 @@
1
- export { TextCell } from './text-cell';
2
1
  export { NumberCell } from './number-cell';
3
2
  export { BooleanCell } from './boolean-cell';
3
+ export { LinkCell } from './link-cell';
4
+ export { DescriptionCell } from './description-cell';
5
+ export { AvatarCell } from './avatar-cell';
6
+ export { LabelCell } from './label-cell';
7
+ export type { NumberCellProps } from './number-cell';
8
+ export type { BooleanCellProps } from './boolean-cell';
9
+ export type { LinkCellProps } from './link-cell';
10
+ export type { AvatarCellProps } from './avatar-cell';
11
+ export type { LabelCellProps } from './label-cell';
12
+ export type { DescriptionCellProps } from './description-cell';
@@ -0,0 +1,10 @@
1
+ import { CellValue } from '../../table.type';
2
+ export interface LabelCellProps {
3
+ value: CellValue;
4
+ rightIcon?: React.ReactNode;
5
+ leftIcon?: React.ReactNode;
6
+ className?: string;
7
+ helperText?: string;
8
+ description?: string;
9
+ }
10
+ export declare const LabelCell: React.FC<LabelCellProps>;
@@ -0,0 +1,47 @@
1
+ import { jsxs as e, jsx as l } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as a } from "../../../../lib/utils.js";
4
+ const u = ({
5
+ value: i,
6
+ leftIcon: n,
7
+ rightIcon: t,
8
+ className: c,
9
+ helperText: m,
10
+ description: s
11
+ }) => {
12
+ const r = "min-h-max min-w-max";
13
+ return /* @__PURE__ */ e(
14
+ "div",
15
+ {
16
+ className: a(
17
+ "flex flex-row gap-2.5 items-center hover:bg-background-neutral-light h-full min-w-full leading-none-medium-sm p-3",
18
+ s && "flex-col",
19
+ c
20
+ ),
21
+ children: [
22
+ /* @__PURE__ */ e(
23
+ "div",
24
+ {
25
+ className: a(
26
+ "text-text-neutral-primary flex justify-between gap-2.5 min-w-full items-center"
27
+ ),
28
+ children: [
29
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2.5 h-full", children: [
30
+ n && /* @__PURE__ */ l("span", { className: a(r), children: n }),
31
+ i
32
+ ] }),
33
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2.5", children: [
34
+ m && /* @__PURE__ */ l("span", { className: "text-text-neutral-secondary", children: m }),
35
+ t && /* @__PURE__ */ l("span", { className: a(r), children: t })
36
+ ] })
37
+ ]
38
+ }
39
+ ),
40
+ s && /* @__PURE__ */ l("div", { className: "text-text-neutral-secondary w-full", children: s })
41
+ ]
42
+ }
43
+ );
44
+ };
45
+ export {
46
+ u as LabelCell
47
+ };
@@ -0,0 +1,10 @@
1
+ import { CellValue } from '../../table.type';
2
+ export interface LinkCellProps {
3
+ value: CellValue;
4
+ href: string;
5
+ target?: '_blank' | '_self' | '_parent' | '_top';
6
+ rightIcon?: React.ReactNode;
7
+ leftIcon?: React.ReactNode;
8
+ className?: string;
9
+ }
10
+ export declare const LinkCell: React.FC<LinkCellProps>;
@@ -0,0 +1,35 @@
1
+ import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as e } from "../../../../lib/utils.js";
4
+ const p = ({
5
+ value: i,
6
+ href: m,
7
+ target: t = "_self",
8
+ leftIcon: n,
9
+ rightIcon: r,
10
+ className: o
11
+ }) => {
12
+ const l = "min-h-max min-w-max";
13
+ return /* @__PURE__ */ s(
14
+ "a",
15
+ {
16
+ href: m,
17
+ target: t,
18
+ rel: "noopener noreferrer",
19
+ className: e(
20
+ "text-text-brand-secondary p-3 leading-none-medium-sm flex flex-row justify-between hover:bg-background-neutral-light gap-2.5 min-w-full min-h-full items-center",
21
+ o
22
+ ),
23
+ children: [
24
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2.5 h-full", children: [
25
+ n && /* @__PURE__ */ a("span", { className: e(l), children: n }),
26
+ i
27
+ ] }),
28
+ r && /* @__PURE__ */ a("span", { className: e(l), children: r })
29
+ ]
30
+ }
31
+ );
32
+ };
33
+ export {
34
+ p as LinkCell
35
+ };
@@ -1,7 +1,9 @@
1
1
  import { CellValue } from '../../table.type';
2
- import * as React from 'react';
3
- interface NumberCellProps {
2
+ export interface NumberCellProps {
4
3
  value: CellValue;
4
+ rightIcon?: React.ReactNode;
5
+ leftIcon?: React.ReactNode;
6
+ className?: string;
7
+ helperText?: string;
5
8
  }
6
9
  export declare const NumberCell: React.FC<NumberCellProps>;
7
- export {};
@@ -1,5 +1,42 @@
1
- import { jsx as t, Fragment as n } from "react/jsx-runtime";
2
- const o = ({ value: e }) => /* @__PURE__ */ t(n, { children: ((r) => r == null ? "" : typeof r == "number" ? new Intl.NumberFormat().format(r) : String(r))(e) });
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import "react";
3
+ import { cn as l } from "../../../../lib/utils.js";
4
+ const u = ({
5
+ value: r,
6
+ leftIcon: s,
7
+ rightIcon: n,
8
+ className: t,
9
+ helperText: i
10
+ }) => {
11
+ const m = "min-h-max min-w-max";
12
+ return /* @__PURE__ */ e(
13
+ "div",
14
+ {
15
+ className: l(
16
+ "flex gap-2.5 items-center hover:bg-background-neutral-light h-full min-w-full leading-none-medium-sm p-3",
17
+ t
18
+ ),
19
+ children: /* @__PURE__ */ a(
20
+ "div",
21
+ {
22
+ className: l(
23
+ "text-text-neutral-primary flex justify-between gap-2.5 min-w-full items-center"
24
+ ),
25
+ children: [
26
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2.5 h-full", children: [
27
+ s && /* @__PURE__ */ e("span", { className: l(m), children: s }),
28
+ i && /* @__PURE__ */ e("span", { className: "text-text-neutral-secondary", children: i })
29
+ ] }),
30
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2.5", children: [
31
+ r,
32
+ n && /* @__PURE__ */ e("span", { className: l(m), children: n })
33
+ ] })
34
+ ]
35
+ }
36
+ )
37
+ }
38
+ );
39
+ };
3
40
  export {
4
- o as NumberCell
41
+ u as NumberCell
5
42
  };
@@ -1,5 +1,5 @@
1
1
  export { TableCell } from './table-cell';
2
- export { TextCell, NumberCell, BooleanCell } from './cell';
2
+ export { NumberCell, BooleanCell, AvatarCell, DescriptionCell, LabelCell, LinkCell } from './cell';
3
3
  export { TableHeader } from './table-header';
4
4
  export { TableRow } from './table-row';
5
5
  export { TableEmptyState } from './table-empty-state';
@@ -1,4 +1,5 @@
1
1
  export { Pagination, default } from './pagination';
2
+ export { PaginationInfo, PaginationQuickJumper } from './components';
2
3
  export type { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps, } from './pagination.type';
3
4
  export { usePagination } from './pagination.hook';
4
5
  export { usePaginationQuickJumper } from './components/pagination-quick-jumper.hook';
@@ -1,5 +1,5 @@
1
1
  import { PaginationHookProps, PaginationHookReturn } from './pagination.type';
2
- export declare const usePagination: (props: PaginationHookProps) => PaginationHookReturn & {
2
+ export declare const usePagination: ({ currentPage, totalPage, maxVisiblePages, }: PaginationHookProps) => PaginationHookReturn & {
3
3
  goToPage: (page: number) => boolean;
4
4
  canGoToPage: (page: number) => boolean;
5
5
  };
@@ -1,22 +1,26 @@
1
- import { useMemo as i, useCallback as o } from "react";
2
- import { calculateVisiblePages as l, isValidPageNumber as P } from "./pagination.utils.js";
3
- const u = (a) => {
4
- const n = i(
5
- () => l(a),
6
- [a.currentPage, a.totalPage, a.maxVisiblePages]
7
- ), e = o(
8
- (t) => P(t, a.totalPage),
9
- [a.totalPage]
10
- ), g = o(
11
- (t) => e(t),
12
- [e]
1
+ import { useMemo as u, useCallback as s } from "react";
2
+ import { calculateVisiblePages as a, isValidPageNumber as m } from "./pagination.utils.js";
3
+ const f = ({
4
+ currentPage: e,
5
+ totalPage: o,
6
+ maxVisiblePages: i
7
+ }) => {
8
+ const t = u(
9
+ () => a({ currentPage: e, totalPage: o, maxVisiblePages: i }),
10
+ [e, o, i]
11
+ ), n = s(
12
+ (r) => m(r, o),
13
+ [o]
14
+ ), c = s(
15
+ (r) => n(r),
16
+ [n]
13
17
  );
14
18
  return {
15
- ...n,
16
- goToPage: g,
17
- canGoToPage: e
19
+ ...t,
20
+ goToPage: c,
21
+ canGoToPage: n
18
22
  };
19
23
  };
20
24
  export {
21
- u as usePagination
25
+ f as usePagination
22
26
  };
@@ -1,7 +1,7 @@
1
1
  import { CellValue, CellType, CellRenderer, TableProps } from '../table.type';
2
2
  import * as React from 'react';
3
3
  interface TableCellProps {
4
- value: CellValue;
4
+ value: CellValue | Record<string, unknown>;
5
5
  cellType: CellType;
6
6
  cellRenderer?: CellRenderer;
7
7
  customCells?: Record<string, CellRenderer>;
@@ -1,46 +1,55 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { TABLE_CSS_CLASSES as r } from "../table.const.js";
3
- import { TextCell as m } from "./cell/text-cell.js";
4
- import { NumberCell as h } from "./cell/number-cell.js";
5
- import { BooleanCell as b } from "./cell/boolean-cell.js";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { TABLE_CSS_CLASSES as s } from "../table.const.js";
3
+ import { NumberCell as S } from "./cell/number-cell.js";
4
+ import { BooleanCell as C } from "./cell/boolean-cell.js";
5
+ import { LinkCell as d } from "./cell/link-cell.js";
6
+ import { DescriptionCell as h } from "./cell/description-cell.js";
7
+ import { AvatarCell as u } from "./cell/avatar-cell.js";
8
+ import { LabelCell as c } from "./cell/label-cell.js";
6
9
  import "react";
7
- import { cn as S } from "../../../lib/utils.js";
8
- const E = ({
9
- value: t,
10
- cellType: n,
11
- cellRenderer: f,
10
+ import { cn as B } from "../../../lib/utils.js";
11
+ const T = ({
12
+ value: o,
13
+ cellType: m,
14
+ cellRenderer: n,
12
15
  record: i,
13
- index: C,
16
+ index: a,
14
17
  customCells: e,
15
- cell: s
18
+ cell: b
16
19
  }) => {
17
- const p = {
18
- text: m,
19
- number: h,
20
- boolean: b,
21
- checkbox: m
22
- }, a = e == null ? void 0 : e[n];
23
- let o;
24
- if (f)
25
- o = f({ value: t, record: i, index: C });
26
- else if (a)
27
- o = /* @__PURE__ */ l(a, { value: t, record: i, index: C });
20
+ const A = {
21
+ text: c,
22
+ number: S,
23
+ boolean: C,
24
+ checkbox: C,
25
+ link: d,
26
+ avatar: u,
27
+ label: c
28
+ }, f = e == null ? void 0 : e[m];
29
+ let r;
30
+ if (n)
31
+ r = n({ value: o, record: i, index: a });
32
+ else if (f)
33
+ r = /* @__PURE__ */ t(f, { value: o, record: i, index: a });
28
34
  else {
29
- const c = p[n] ?? m;
30
- o = /* @__PURE__ */ l(c, { value: t });
35
+ const l = A[m] ?? h;
36
+ if (typeof o == "object" && o !== null && !Array.isArray(o)) {
37
+ const p = o, L = { value: p.value ?? "", ...p };
38
+ r = /* @__PURE__ */ t(l, { ...L });
39
+ } else
40
+ r = /* @__PURE__ */ t(l, { value: o ?? "" });
31
41
  }
32
- return /* @__PURE__ */ l(
42
+ return /* @__PURE__ */ t(
33
43
  "td",
34
44
  {
35
- className: S(
36
- r.cell.default,
37
- r.cell.cellHeight[s.cellHeight],
38
- r.cell.hasBorder[s.hasBorder ? "true" : "false"]
45
+ className: B(
46
+ s.cell.default,
47
+ s.cell.hasBorder[b.hasBorder ? "true" : "false"]
39
48
  ),
40
- children: o
49
+ children: r
41
50
  }
42
51
  );
43
52
  };
44
53
  export {
45
- E as TableCell
54
+ T as TableCell
46
55
  };