@ztwoint/z-ui 0.1.29 → 0.1.31

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 (49) hide show
  1. package/dist/components/button/button.js +10 -11
  2. package/dist/components/input/input.d.ts +2 -1
  3. package/dist/components/input/input.js +37 -8
  4. package/dist/components/input/input.type.d.ts +6 -0
  5. package/dist/components/table/components/index.d.ts +4 -3
  6. package/dist/components/table/components/pagination/pagination.const.d.ts +2 -2
  7. package/dist/components/table/components/pagination/pagination.const.js +4 -4
  8. package/dist/components/table/components/pagination/pagination.js +67 -63
  9. package/dist/components/table/components/table-filter/table-filter.js +1 -1
  10. package/dist/components/table/components/table-footer-content.js +11 -4
  11. package/dist/components/table/components/table-footer.js +10 -4
  12. package/dist/components/table/components/table-header/table-header.d.ts +1 -0
  13. package/dist/components/table/components/table-header/table-header.js +34 -23
  14. package/dist/components/table/components/table-header-content.js +2 -2
  15. package/dist/components/table/components/table-header-wrapper.js +10 -4
  16. package/dist/components/table/components/table-search/index.d.ts +1 -0
  17. package/dist/components/table/components/table-search/table-search.d.ts +7 -0
  18. package/dist/components/table/components/table-search/table-search.js +21 -0
  19. package/dist/components/table/table-provider.d.ts +2 -0
  20. package/dist/components/table/table-provider.js +29 -27
  21. package/dist/components/table/table.d.ts +4 -1
  22. package/dist/components/table/table.js +26 -24
  23. package/dist/components/table/table.type.d.ts +5 -0
  24. package/dist/components/table-card/index.d.ts +2 -0
  25. package/dist/components/table-card/table-card.d.ts +4 -0
  26. package/dist/components/table-card/table-card.type.d.ts +36 -0
  27. package/dist/css/config/colors/defaults.css +16 -7
  28. package/dist/css/config/components/index.css +1 -0
  29. package/dist/css/config/components/input.css +56 -0
  30. package/dist/css/styles/tailwind.css +1 -1
  31. package/dist/index.js +36 -36
  32. package/dist/routes/index.d.ts +1 -0
  33. package/dist/routes/table-card.d.ts +2 -0
  34. package/dist/types/components/input/input.d.ts +2 -1
  35. package/dist/types/components/input/input.type.d.ts +6 -0
  36. package/dist/types/components/table/components/index.d.ts +4 -3
  37. package/dist/types/components/table/components/pagination/pagination.const.d.ts +2 -2
  38. package/dist/types/components/table/components/table-header/table-header.d.ts +1 -0
  39. package/dist/types/components/table/components/table-search/index.d.ts +1 -0
  40. package/dist/types/components/table/components/table-search/table-search.d.ts +7 -0
  41. package/dist/types/components/table/table-provider.d.ts +2 -0
  42. package/dist/types/components/table/table.d.ts +4 -1
  43. package/dist/types/components/table/table.type.d.ts +5 -0
  44. package/dist/types/components/table-card/index.d.ts +2 -0
  45. package/dist/types/components/table-card/table-card.d.ts +4 -0
  46. package/dist/types/components/table-card/table-card.type.d.ts +36 -0
  47. package/dist/types/routes/index.d.ts +1 -0
  48. package/dist/types/routes/table-card.d.ts +2 -0
  49. package/package.json +1 -1
@@ -8,17 +8,15 @@ const k = z(
8
8
  {
9
9
  variants: {
10
10
  variant: {
11
- filled: [
12
- "border-[.5px] disabled:border-none disabled:shadow-[var(--shadow-button-disabled)]"
13
- ],
14
- stroke: ["disabled:shadow-[var(--shadow-button-disabled)]"],
11
+ filled: ["border-[.5px] disabled:border-none disabled:shadow-button-disabled"],
12
+ stroke: ["disabled:shadow-button-disabled"],
15
13
  ghost: [""]
16
14
  },
17
15
  shade: {
18
16
  brand: "bg-button-primary-brand-surface-default border-button-primary-brand-surface-default text-text-inverted-primary hover:bg-button-primary-brand-surface-hover active:bg-button-primary-brand-surface-pressed disabled:bg-button-primary-brand-surface-disabled disabled:text-text-neutral-muted disabled:border-button-primary-brand-surface-disabled",
19
17
  neutral: "bg-button-primary-neutral-surface-default border-button-primary-neutral-surface-default disabled:border-none text-text-inverted-primary hover:bg-button-primary-neutral-surface-hover active:bg-button-primary-neutral-surface-pressed disabled:bg-button-primary-neutral-surface-disabled disabled:text-text-neutral-muted",
20
18
  danger: "bg-button-primary-danger-surface-default border-button-primary-danger-stroke-default text-text-inverted-primary hover:bg-button-primary-danger-surface-hover active:bg-button-primary-danger-surface-pressed disabled:bg-button-primary-danger-surface-disabled disabled:text-text-neutral-muted",
21
- neutralGhost: "border-none text-text-neutral-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted hover:bg-transparent"
19
+ neutralGhost: "border-none text-text-neutral-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted"
22
20
  },
23
21
  size: {
24
22
  large: "gap-1",
@@ -96,14 +94,15 @@ const k = z(
96
94
  asChild: o = !1,
97
95
  leftIcon: t,
98
96
  rightIcon: a,
99
- label: p,
97
+ label: m,
100
98
  children: u,
101
- ...m
99
+ ...p
102
100
  }, y) => {
103
- const f = o ? O : "button", r = p || u, n = !r && !!(t || a), l = n ? t || a : null, g = d(
104
- k({ shade: b, size: c, variant: x, iconOnly: n, className: i })
105
- ), s = "w-3.5 h-3.5";
106
- return /* @__PURE__ */ e(f, { className: g, ref: y, ...m, children: o ? u : n ? l ? /* @__PURE__ */ e("span", { className: s, children: l }) : null : /* @__PURE__ */ v(h, { children: [
101
+ const f = o ? O : "button", r = m || u, n = !r && !!(t || a), l = n ? t || a : null, g = d(
102
+ k({ shade: b, size: c, variant: x, iconOnly: n }),
103
+ i
104
+ ), s = "w-3.5 h-3.5 min-w-max";
105
+ return /* @__PURE__ */ e(f, { className: g, ref: y, ...p, children: o ? u : n ? l ? /* @__PURE__ */ e("span", { className: s, children: l }) : null : /* @__PURE__ */ v(h, { children: [
107
106
  t && /* @__PURE__ */ e("span", { className: d(s), children: t }),
108
107
  r && /* @__PURE__ */ e("span", { children: r }),
109
108
  a && /* @__PURE__ */ e("span", { className: d(s), children: a })
@@ -1,2 +1,3 @@
1
1
  import { default as React } from 'react';
2
- export declare const Input: React.FC<React.InputHTMLAttributes<HTMLInputElement>>;
2
+ import { InputProps } from './input.type';
3
+ export declare const Input: React.FC<InputProps>;
@@ -1,11 +1,40 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- const e = (r) => /* @__PURE__ */ o(
3
- "input",
4
- {
5
- className: "border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
6
- ...r
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import { cva as _ } from "class-variance-authority";
3
+ import "react";
4
+ import { cn as e } from "../../lib/utils.js";
5
+ const d = _("", {
6
+ variants: {
7
+ size: {
8
+ small: "p-1.5 gap-1 h-[26px]",
9
+ large: "p-2 gap-1.5 h-[30px]"
10
+ }
7
11
  }
8
- );
12
+ }), m = ({ size: s, leftIcon: a, rightIcon: n, className: o, ...i }) => {
13
+ const r = " w-3.5 h-3.5 text-text-neutral-secondary has-[:disabled]:text-input-surface-disabled", { ...p } = i;
14
+ return /* @__PURE__ */ l(
15
+ "div",
16
+ {
17
+ className: e(
18
+ "rounded-lg bg-input-surface-default flex items-center shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.default)] hover:shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.hover)] focus-within:shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.active),0_1px_2px_0_rgba(0,0,0,0.05)] focus-within:hover:shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.active),0_1px_2px_0_rgba(0,0,0,0.05)] has-[:disabled]:shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.disabled)]",
19
+ d({ size: s }),
20
+ o
21
+ ),
22
+ children: [
23
+ a && /* @__PURE__ */ t("span", { className: e(r, s === "large" && "w-4 h-4"), children: a }),
24
+ /* @__PURE__ */ t(
25
+ "input",
26
+ {
27
+ className: e(
28
+ "bg-transparent text-text-neutral-primary placeholder:text-text-neutral-muted disabled:text-text-neutral-muted leading-none-medium-sm border-none outline-none flex-1"
29
+ ),
30
+ ...p
31
+ }
32
+ ),
33
+ n && /* @__PURE__ */ t("span", { className: e(r), children: n })
34
+ ]
35
+ }
36
+ );
37
+ };
9
38
  export {
10
- e as Input
39
+ m as Input
11
40
  };
@@ -0,0 +1,6 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
3
+ size: 'large' | 'small';
4
+ leftIcon?: React.ReactNode;
5
+ rightIcon?: React.ReactNode;
6
+ }
@@ -1,11 +1,12 @@
1
1
  export { TableCell } from './table-cell';
2
- export { TableHeader, TableSortIcon } from './table-header';
2
+ export { TextCell, NumberCell, BooleanCell } from './cell';
3
+ export { TableHeader } from './table-header';
3
4
  export { TableRow } from './table-row';
4
5
  export { TableEmptyState } from './table-empty-state';
5
6
  export { TableLoadingState } from './table-loading-state';
6
- export { Pagination as TablePagination } from './pagination';
7
+ export { Pagination as TablePagination } from './pagination/pagination';
7
8
  export { TableHeaderWrapper } from './table-header-wrapper';
8
9
  export { TableHeaderContent } from './table-header-content';
9
10
  export { TableFooter } from './table-footer';
10
11
  export { TableFooterContent } from './table-footer-content';
11
- export * from './cell';
12
+ export { TableSearch } from './table-search';
@@ -9,9 +9,9 @@ export declare const PAGINATION_CSS_CLASSES: {
9
9
  readonly buttonActive: "bg-blue-600 text-white border-blue-600 hover:bg-blue-700";
10
10
  readonly buttonIcon: "flex items-center justify-center w-8 h-8 text-sm rounded border border-gray-300 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed transition-colors";
11
11
  readonly ellipsis: "flex items-center justify-center w-8 h-8 text-gray-400";
12
- readonly info: "text-sm text-text-neutral-secondary";
12
+ readonly info: "leading-none-sm text-text-neutral-secondary";
13
13
  readonly jumper: "flex items-center gap-2 text-sm text-text-neutral-primary";
14
- readonly input: "w-16 px-2 py-1 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent";
14
+ readonly input: "w-16 px-2 py-1 text-sm h-6 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent";
15
15
  };
16
16
  export declare const PAGINATION_LABELS: {
17
17
  readonly previous: "Previous page";
@@ -2,10 +2,10 @@ const e = {
2
2
  MAX_VISIBLE_PAGES: 6
3
3
  }, t = {
4
4
  ellipsis: "flex items-center justify-center w-8 h-8 text-gray-400",
5
- info: "text-sm text-text-neutral-secondary",
5
+ info: "leading-none-sm text-text-neutral-secondary",
6
6
  jumper: "flex items-center gap-2 text-sm text-text-neutral-primary",
7
- input: "w-16 px-2 py-1 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
8
- }, r = {
7
+ input: "w-16 px-2 py-1 text-sm h-6 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
8
+ }, o = {
9
9
  previous: "Previous page",
10
10
  next: "Next page",
11
11
  first: "First page",
@@ -18,5 +18,5 @@ const e = {
18
18
  export {
19
19
  t as PAGINATION_CSS_CLASSES,
20
20
  e as PAGINATION_DEFAULTS,
21
- r as PAGINATION_LABELS
21
+ o as PAGINATION_LABELS
22
22
  };
@@ -1,112 +1,116 @@
1
- import { jsxs as I, jsx as s } from "react/jsx-runtime";
2
- import { usePagination as S } from "./pagination.hook.js";
3
- import { PAGINATION_LABELS as o, PAGINATION_DEFAULTS as x, PAGINATION_CSS_CLASSES as E } from "./pagination.const.js";
4
- import { Button as d } from "../../../button/button.js";
5
- import k from "../../../assets/icons/chevron-left.js";
6
- import N from "../../../assets/icons/chevron-right.js";
7
- import L from "../../../assets/icons/double-chevron-left.js";
8
- import _ from "../../../assets/icons/double-chevron-right.js";
1
+ import { jsxs as v, jsx as e } from "react/jsx-runtime";
2
+ import { usePagination as A } from "./pagination.hook.js";
3
+ import { PAGINATION_LABELS as o, PAGINATION_DEFAULTS as C, PAGINATION_CSS_CLASSES as S } from "./pagination.const.js";
4
+ import { Button as m } from "../../../button/button.js";
5
+ import E from "../../../assets/icons/chevron-left.js";
6
+ import k from "../../../assets/icons/chevron-right.js";
7
+ import y from "../../../assets/icons/double-chevron-left.js";
8
+ import L from "../../../assets/icons/double-chevron-right.js";
9
9
  import "react";
10
- import { cn as z } from "../../../../lib/utils.js";
11
- const p = () => /* @__PURE__ */ s("span", { className: E.ellipsis, children: "..." }), V = ({
12
- currentPage: i,
13
- totalPage: r,
14
- onChange: b,
15
- disabled: t = !1
10
+ import { cn as _ } from "../../../../lib/utils.js";
11
+ const p = () => /* @__PURE__ */ e("span", { className: S.ellipsis, children: "..." }), $ = ({
12
+ currentPage: t,
13
+ totalPage: l,
14
+ onChange: x,
15
+ disabled: r = !1
16
16
  }) => {
17
- const { visiblePages: m, hasEllipsisStart: v, hasEllipsisEnd: A } = S({
18
- currentPage: i,
19
- totalPage: r,
20
- maxVisiblePages: x.MAX_VISIBLE_PAGES
17
+ const { visiblePages: d, hasEllipsisStart: b, hasEllipsisEnd: N } = A({
18
+ currentPage: t,
19
+ totalPage: l,
20
+ maxVisiblePages: C.MAX_VISIBLE_PAGES
21
21
  });
22
- if (r <= 1)
22
+ if (l <= 1)
23
23
  return null;
24
- const f = i === 1, c = i === r, a = (e) => {
25
- !t && e !== i && e >= 1 && e <= r && b(e);
26
- }, C = () => {
27
- const e = [];
28
- let h = !1, u = !1;
29
- return m.forEach((l, y) => {
30
- v && l === m[1] && !h && (e.push(/* @__PURE__ */ s(p, {}, "ellipsis-start")), h = !0);
31
- const n = l === i;
32
- e.push(
33
- /* @__PURE__ */ s(
34
- d,
24
+ const c = t === 1, f = t === l, i = (s) => {
25
+ !r && s !== t && s >= 1 && s <= l && x(s);
26
+ }, I = () => {
27
+ const s = [];
28
+ let u = !1, h = !1;
29
+ return d.forEach((a, z) => {
30
+ b && a === d[1] && !u && (s.push(/* @__PURE__ */ e(p, {}, "ellipsis-start")), u = !0);
31
+ const n = a === t;
32
+ s.push(
33
+ /* @__PURE__ */ e(
34
+ m,
35
35
  {
36
- onClick: () => a(l),
36
+ onClick: () => i(a),
37
37
  variant: "stroke",
38
38
  shade: n ? "brand" : "neutral",
39
39
  size: "small",
40
- "aria-label": `${o.page} ${l}`,
40
+ "aria-label": `${o.page} ${a}`,
41
41
  "aria-current": n ? "page" : void 0,
42
- className: z(
43
- "min-w-[29px] text-text-neutral-secondary",
44
- n && "border border-button-primary-brand-surface-default"
42
+ className: _(
43
+ "text-text-neutral-secondary",
44
+ n && "border border-button-primary-brand-surface-default text-text-neutral-primary"
45
45
  ),
46
46
  style: {
47
47
  borderStyle: n ? "solid" : "none",
48
48
  boxShadow: n ? "none" : ""
49
49
  },
50
- children: l
50
+ leftIcon: /* @__PURE__ */ e("span", { className: "leading-none-medium-sm", children: a })
51
51
  },
52
- l
52
+ a
53
53
  )
54
- ), A && l === m[m.length - 2] && !u && (e.push(/* @__PURE__ */ s(p, {}, "ellipsis-end")), u = !0);
55
- }), e;
54
+ ), N && a === d[d.length - 2] && !h && (s.push(/* @__PURE__ */ e(p, {}, "ellipsis-end")), h = !0);
55
+ }), s;
56
56
  };
57
- return /* @__PURE__ */ I("div", { className: "flex gap-1", children: [
58
- /* @__PURE__ */ s(
59
- d,
57
+ return /* @__PURE__ */ v("div", { className: "flex gap-1.5 items-center", children: [
58
+ /* @__PURE__ */ e(
59
+ m,
60
60
  {
61
61
  "aria-label": o.first,
62
- onClick: () => a(1),
63
- disabled: t || f,
62
+ onClick: () => i(1),
63
+ disabled: r || c,
64
64
  variant: "stroke",
65
65
  shade: "neutral",
66
66
  size: "small",
67
- leftIcon: /* @__PURE__ */ s(L, {})
67
+ className: "text-text-neutral-secondary",
68
+ leftIcon: /* @__PURE__ */ e(y, {})
68
69
  }
69
70
  ),
70
- /* @__PURE__ */ s(
71
- d,
71
+ /* @__PURE__ */ e(
72
+ m,
72
73
  {
73
74
  "aria-label": o.previous,
74
- onClick: () => a(i - 1),
75
- disabled: t || f,
75
+ onClick: () => i(t - 1),
76
+ disabled: r || c,
76
77
  variant: "stroke",
77
78
  shade: "neutral",
78
79
  size: "small",
79
- leftIcon: /* @__PURE__ */ s(k, {})
80
+ className: "text-text-neutral-secondary",
81
+ leftIcon: /* @__PURE__ */ e(E, {})
80
82
  }
81
83
  ),
82
- C(),
83
- /* @__PURE__ */ s(
84
- d,
84
+ I(),
85
+ /* @__PURE__ */ e(
86
+ m,
85
87
  {
86
88
  "aria-label": o.next,
87
- onClick: () => a(i + 1),
88
- disabled: t || c,
89
+ onClick: () => i(t + 1),
90
+ disabled: r || f,
89
91
  variant: "stroke",
90
92
  shade: "neutral",
91
93
  size: "small",
92
- leftIcon: /* @__PURE__ */ s(N, {})
94
+ className: "text-text-neutral-secondary",
95
+ leftIcon: /* @__PURE__ */ e(k, {})
93
96
  }
94
97
  ),
95
- /* @__PURE__ */ s(
96
- d,
98
+ /* @__PURE__ */ e(
99
+ m,
97
100
  {
98
101
  "aria-label": o.last,
99
- onClick: () => a(r),
100
- disabled: t || c,
102
+ onClick: () => i(l),
103
+ disabled: r || f,
101
104
  variant: "stroke",
102
105
  shade: "neutral",
103
106
  size: "small",
104
- leftIcon: /* @__PURE__ */ s(_, {})
107
+ className: "text-text-neutral-secondary",
108
+ leftIcon: /* @__PURE__ */ e(L, {})
105
109
  }
106
110
  )
107
111
  ] });
108
112
  };
109
113
  export {
110
- V as Pagination,
111
- V as default
114
+ $ as Pagination,
115
+ $ as default
112
116
  };
@@ -21,7 +21,7 @@ const C = ({
21
21
  updateFilterRule: u
22
22
  } = N({ schema: c, filter: n || { value: [], onChange: () => {
23
23
  } } });
24
- return n ? /* @__PURE__ */ r("div", { className: "relative mb-4", children: [
24
+ return n ? /* @__PURE__ */ r("div", { className: "relative", children: [
25
25
  /* @__PURE__ */ r(
26
26
  s,
27
27
  {
@@ -1,9 +1,16 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- const s = ({
2
+ const a = ({
3
3
  children: e,
4
4
  className: t = ""
5
- }) => /* @__PURE__ */ o("div", { className: `flex items-center ${t}`, children: e });
5
+ }) => /* @__PURE__ */ o(
6
+ "div",
7
+ {
8
+ className: `flex items-center
9
+ gap-3 ${t}`,
10
+ children: e
11
+ }
12
+ );
6
13
  export {
7
- s as TableFooterContent,
8
- s as default
14
+ a as TableFooterContent,
15
+ a as default
9
16
  };
@@ -1,6 +1,12 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- const o = ({ children: e, className: t = "" }) => /* @__PURE__ */ r("div", { className: `flex justify-between items-center ${t}`, children: e });
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ const l = ({ children: e, className: r = "" }) => /* @__PURE__ */ t(
3
+ "div",
4
+ {
5
+ className: `flex justify-between items-center bg-neutral-default border-stroke-solid-light border border-t-[0.5px] gap-3 p-2 pl-4 rounded-b-xl ${r} `,
6
+ children: e
7
+ }
8
+ );
3
9
  export {
4
- o as TableFooter,
5
- o as default
10
+ l as TableFooter,
11
+ l as default
6
12
  };
@@ -4,6 +4,7 @@ interface TableHeaderProps {
4
4
  schema: TableSchemaColumn[];
5
5
  sort?: TableSort;
6
6
  cell: TableProps['cell'];
7
+ stickyHeader?: boolean;
7
8
  }
8
9
  export declare const TableHeader: React.FC<TableHeaderProps>;
9
10
  export {};
@@ -1,27 +1,38 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
2
  import { TABLE_CSS_CLASSES as t } from "../../table.const.js";
3
- import { TableSortIcon as c } from "./table-sort-icon.js";
4
- import { getCurrentSortDirection as n, isSortActive as h, handleSortClick as p } from "./table-header.utils.js";
3
+ import { TableSortIcon as n } from "./table-sort-icon.js";
4
+ import { getCurrentSortDirection as h, isSortActive as p, handleSortClick as C } from "./table-header.utils.js";
5
5
  import "react";
6
- import { cn as C } from "../../../../lib/utils.js";
7
- const y = ({ schema: a, sort: i, cell: o }) => /* @__PURE__ */ r("thead", { className: t.header, children: /* @__PURE__ */ r("tr", { children: a.map((e) => {
8
- const s = n(e.key, i), l = h(e.key, i);
9
- return /* @__PURE__ */ r(
10
- "th",
11
- {
12
- className: C(
13
- e.sortable ? t.sortableHeaderCell : t.headerCell,
14
- t.cell.hasBorder[o.hasBorder ? "true" : "false"]
15
- ),
16
- onClick: e.sortable ? () => p(e.key, i) : void 0,
17
- children: /* @__PURE__ */ d("div", { className: t.headerCellContent, children: [
18
- /* @__PURE__ */ r("span", { children: e.title }),
19
- e.sortable && /* @__PURE__ */ r(c, { direction: s, isActive: l })
20
- ] })
21
- },
22
- e.key
23
- );
24
- }) }) });
6
+ import { cn as S } from "../../../../lib/utils.js";
7
+ const x = ({
8
+ schema: a,
9
+ sort: i,
10
+ cell: o,
11
+ stickyHeader: s = !1
12
+ }) => /* @__PURE__ */ r(
13
+ "thead",
14
+ {
15
+ className: `${t.header} ${s ? "sticky top-[-1.5px] z-10" : ""}`,
16
+ children: /* @__PURE__ */ r("tr", { children: a.map((e) => {
17
+ const l = h(e.key, i), d = p(e.key, i);
18
+ return /* @__PURE__ */ r(
19
+ "th",
20
+ {
21
+ className: S(
22
+ e.sortable ? t.sortableHeaderCell : t.headerCell,
23
+ t.cell.hasBorder[o.hasBorder ? "true" : "false"]
24
+ ),
25
+ onClick: e.sortable ? () => C(e.key, i) : void 0,
26
+ children: /* @__PURE__ */ c("div", { className: t.headerCellContent, children: [
27
+ /* @__PURE__ */ r("span", { children: e.title }),
28
+ e.sortable && /* @__PURE__ */ r(n, { direction: l, isActive: d })
29
+ ] })
30
+ },
31
+ e.key
32
+ );
33
+ }) })
34
+ }
35
+ );
25
36
  export {
26
- y as TableHeader
37
+ x as TableHeader
27
38
  };
@@ -1,8 +1,8 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as a } from "react/jsx-runtime";
2
2
  const s = ({
3
3
  children: e,
4
4
  className: t = ""
5
- }) => /* @__PURE__ */ r("div", { className: `flex items-center ${t}`, children: e });
5
+ }) => /* @__PURE__ */ a("div", { className: `flex items-center justify-between gap-3 ${t}`, children: e });
6
6
  export {
7
7
  s as TableHeaderContent,
8
8
  s as default
@@ -1,9 +1,15 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- const s = ({
2
+ const o = ({
3
3
  children: e,
4
4
  className: r = ""
5
- }) => /* @__PURE__ */ t("div", { className: `flex justify-between items-center ${r}`, children: e });
5
+ }) => /* @__PURE__ */ t(
6
+ "div",
7
+ {
8
+ className: `p-3 gap-3 flex justify-between items-center border-stroke-solid-medium border-1 border-b-0 rounded-t-xl ${r}`,
9
+ children: e
10
+ }
11
+ );
6
12
  export {
7
- s as TableHeaderWrapper,
8
- s as default
13
+ o as TableHeaderWrapper,
14
+ o as default
9
15
  };
@@ -0,0 +1 @@
1
+ export { TableSearch } from './table-search';
@@ -0,0 +1,7 @@
1
+ import { TableSearch as TableSearchType } from '../../table.type';
2
+ import * as React from 'react';
3
+ export interface TableSearchProps {
4
+ search: TableSearchType;
5
+ className?: string;
6
+ }
7
+ export declare const TableSearch: React.FC<TableSearchProps>;
@@ -0,0 +1,21 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Input as c } from "../../../input/input.js";
3
+ import { MagnifierIcon as l } from "../../../assets/icons/magnifier-icon.js";
4
+ const h = ({ search: r, className: o = "" }) => {
5
+ const { value: t, onChange: a, placeholder: n = "Search by Item Number or Description" } = r;
6
+ return /* @__PURE__ */ e(
7
+ c,
8
+ {
9
+ size: "small",
10
+ leftIcon: /* @__PURE__ */ e(l, { className: "w-4 h-4" }),
11
+ placeholder: n,
12
+ value: t,
13
+ onChange: (m) => a(m.target.value),
14
+ type: "text",
15
+ className: o
16
+ }
17
+ );
18
+ };
19
+ export {
20
+ h as TableSearch
21
+ };
@@ -1,6 +1,7 @@
1
1
  import { TableProps } from './table.type';
2
2
  import { TableBody } from './table';
3
3
  import { TableFilter } from './components/table-filter';
4
+ import { TableSearch } from './components/table-search';
4
5
  import { Pagination } from './components/pagination';
5
6
  import { TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent } from './components';
6
7
  import { PaginationInfo, PaginationQuickJumper } from './components/pagination/components';
@@ -12,6 +13,7 @@ declare const TableProvider: React.FC<TableProviderProps>;
12
13
  interface TableCompoundComponent extends React.FC<TableProviderProps> {
13
14
  Body: typeof TableBody;
14
15
  Filter: typeof TableFilter;
16
+ Search: typeof TableSearch;
15
17
  Pagination: typeof Pagination;
16
18
  PaginationInfo: typeof PaginationInfo;
17
19
  PaginationQuickJumper: typeof PaginationQuickJumper;
@@ -1,45 +1,47 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import * as a from "react";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import * as n from "react";
3
3
  import { TableContext as m } from "./table.context.js";
4
4
  import { TableBody as p } from "./table.js";
5
5
  import { TableFilter as f } from "./components/table-filter/table-filter.js";
6
- import { Pagination as l } from "./components/pagination/pagination.js";
6
+ import { TableSearch as l } from "./components/table-search/table-search.js";
7
+ import { Pagination as s } from "./components/pagination/pagination.js";
7
8
  import "clsx";
8
9
  import "tailwind-merge";
9
- import { TableHeaderWrapper as s } from "./components/table-header-wrapper.js";
10
- import { TableHeaderContent as d } from "./components/table-header-content.js";
11
- import { TableFooter as T } from "./components/table-footer.js";
12
- import { TableFooterContent as b } from "./components/table-footer-content.js";
10
+ import { TableHeaderWrapper as T } from "./components/table-header-wrapper.js";
11
+ import { TableHeaderContent as b } from "./components/table-header-content.js";
12
+ import { TableFooter as c } from "./components/table-footer.js";
13
+ import { TableFooterContent as d } from "./components/table-footer-content.js";
13
14
  import { PaginationInfo as u } from "./components/pagination/components/pagination-info.js";
14
- import { PaginationQuickJumper as c } from "./components/pagination/components/pagination-quick-jumper.js";
15
- const r = ({
15
+ import { PaginationQuickJumper as g } from "./components/pagination/components/pagination-quick-jumper.js";
16
+ const t = ({
16
17
  children: e,
17
- pagination: P,
18
- sort: C,
19
- filter: F,
20
- filterComponents: v,
21
- ...t
18
+ pagination: C,
19
+ sort: F,
20
+ filter: v,
21
+ filterComponents: x,
22
+ ...r
22
23
  }) => {
23
- const i = a.useMemo(
24
+ const i = n.useMemo(
24
25
  () => ({
25
- ...t
26
+ ...r
26
27
  }),
27
- [t]
28
+ [r]
28
29
  );
29
- return /* @__PURE__ */ n(m.Provider, { value: i, children: e });
30
- }, g = r, o = g;
30
+ return /* @__PURE__ */ a(m.Provider, { value: i, children: e });
31
+ }, P = t, o = P;
31
32
  o.Body = p;
32
33
  o.Filter = f;
33
- o.Pagination = l;
34
+ o.Search = l;
35
+ o.Pagination = s;
34
36
  o.PaginationInfo = u;
35
- o.PaginationQuickJumper = c;
36
- o.Provider = r;
37
- o.Header = s;
38
- o.HeaderContent = d;
39
- o.Footer = T;
40
- o.FooterContent = b;
37
+ o.PaginationQuickJumper = g;
38
+ o.Provider = t;
39
+ o.Header = T;
40
+ o.HeaderContent = b;
41
+ o.Footer = c;
42
+ o.FooterContent = d;
41
43
  export {
42
44
  o as Table,
43
- r as TableProvider,
45
+ t as TableProvider,
44
46
  o as default
45
47
  };
@@ -1,4 +1,7 @@
1
1
  import { TableProps } from './table.type';
2
2
  import * as React from 'react';
3
- export declare const TableBody: React.FC<Partial<TableProps>>;
3
+ export declare const TableBody: React.FC<Partial<TableProps> & {
4
+ className?: string;
5
+ stickyHeader?: boolean;
6
+ }>;
4
7
  export default TableBody;