@redis-ui/table 2.4.0

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 (66) hide show
  1. package/dist/Table/Table.cjs +173 -0
  2. package/dist/Table/Table.context.cjs +13 -0
  3. package/dist/Table/Table.context.d.ts +7 -0
  4. package/dist/Table/Table.context.js +13 -0
  5. package/dist/Table/Table.d.ts +7 -0
  6. package/dist/Table/Table.js +173 -0
  7. package/dist/Table/Table.style.cjs +63 -0
  8. package/dist/Table/Table.style.d.ts +14 -0
  9. package/dist/Table/Table.style.js +61 -0
  10. package/dist/Table/Table.test.d.ts +1 -0
  11. package/dist/Table/Table.types.d.ts +31 -0
  12. package/dist/Table/components/ExpandRowButton/ExpandRowButton.cjs +20 -0
  13. package/dist/Table/components/ExpandRowButton/ExpandRowButton.d.ts +8 -0
  14. package/dist/Table/components/ExpandRowButton/ExpandRowButton.js +20 -0
  15. package/dist/Table/components/ExpandRowButton/ExpandRowButton.test.d.ts +1 -0
  16. package/dist/Table/components/ShowOnRowHover/ShowOnRowHover.style.cjs +11 -0
  17. package/dist/Table/components/ShowOnRowHover/ShowOnRowHover.style.d.ts +1 -0
  18. package/dist/Table/components/ShowOnRowHover/ShowOnRowHover.style.js +9 -0
  19. package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.cjs +34 -0
  20. package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.d.ts +2 -0
  21. package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.js +34 -0
  22. package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.cjs +11 -0
  23. package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.d.ts +2 -0
  24. package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.js +9 -0
  25. package/dist/Table/components/TableExpandedRow/TableExpandedRow.cjs +36 -0
  26. package/dist/Table/components/TableExpandedRow/TableExpandedRow.d.ts +2 -0
  27. package/dist/Table/components/TableExpandedRow/TableExpandedRow.js +36 -0
  28. package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.cjs +15 -0
  29. package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.d.ts +2 -0
  30. package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.js +13 -0
  31. package/dist/Table/components/TableExpandedRow/TableExpandedRow.types.d.ts +9 -0
  32. package/dist/Table/components/TableExpandedRow/index.d.ts +3 -0
  33. package/dist/Table/components/TablePagination/TablePagination.cjs +93 -0
  34. package/dist/Table/components/TablePagination/TablePagination.d.ts +4 -0
  35. package/dist/Table/components/TablePagination/TablePagination.js +93 -0
  36. package/dist/Table/components/TablePagination/TablePagination.style.cjs +60 -0
  37. package/dist/Table/components/TablePagination/TablePagination.style.d.ts +50 -0
  38. package/dist/Table/components/TablePagination/TablePagination.style.js +58 -0
  39. package/dist/Table/components/TablePagination/TablePagination.test.d.ts +1 -0
  40. package/dist/Table/index.d.ts +8 -0
  41. package/dist/_virtual/jsx-runtime.cjs +4 -0
  42. package/dist/_virtual/jsx-runtime.js +4 -0
  43. package/dist/_virtual/react-jsx-runtime.development.cjs +4 -0
  44. package/dist/_virtual/react-jsx-runtime.development.js +4 -0
  45. package/dist/_virtual/react-jsx-runtime.production.min.cjs +4 -0
  46. package/dist/_virtual/react-jsx-runtime.production.min.js +4 -0
  47. package/dist/index.cjs +8 -0
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.js +8 -0
  50. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +36 -0
  51. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +18 -0
  52. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +32 -0
  53. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +14 -0
  54. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +63 -0
  55. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +45 -0
  56. package/dist/node_modules/@tanstack/react-table/build/lib/index.cjs +123 -0
  57. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +106 -0
  58. package/dist/node_modules/@tanstack/table-core/build/lib/index.cjs +2816 -0
  59. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +2816 -0
  60. package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +902 -0
  61. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +900 -0
  62. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +35 -0
  63. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +33 -0
  64. package/dist/node_modules/react/jsx-runtime.cjs +12 -0
  65. package/dist/node_modules/react/jsx-runtime.js +12 -0
  66. package/package.json +42 -0
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
4
+ const React = require("react");
5
+ const index = require("../../../node_modules/@radix-ui/react-compose-refs/dist/index.cjs");
6
+ const TableAnimatedExpandedRow_style = require("./TableAnimatedExpandedRow.style.cjs");
7
+ const TableAnimatedExpandedRow = ({
8
+ expanded,
9
+ rowRef,
10
+ ...restProps
11
+ }) => {
12
+ const innerRowRef = React.useRef(null);
13
+ const composedRowRef = index.useComposedRefs(rowRef, innerRowRef);
14
+ React.useEffect(() => {
15
+ if (expanded) {
16
+ const timer = setTimeout(() => {
17
+ var _a;
18
+ return (_a = innerRowRef.current) == null ? void 0 : _a.scrollIntoView({
19
+ block: "nearest",
20
+ behavior: "smooth"
21
+ });
22
+ }, 500);
23
+ return () => clearTimeout(timer);
24
+ }
25
+ return void 0;
26
+ }, [expanded]);
27
+ return jsxRuntime.jsxRuntimeExports.jsx(TableAnimatedExpandedRow_style.AnimatedExpandedRow, {
28
+ rowRef: composedRowRef,
29
+ expanded,
30
+ ...restProps,
31
+ keepInDom: true
32
+ });
33
+ };
34
+ exports.TableAnimatedExpandedRow = TableAnimatedExpandedRow;
@@ -0,0 +1,2 @@
1
+ import { TableExpandedRowProps } from './TableExpandedRow.types';
2
+ export declare const TableAnimatedExpandedRow: <T extends object>({ expanded, rowRef, ...restProps }: TableExpandedRowProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
2
+ import { useRef, useEffect } from "react";
3
+ import { useComposedRefs } from "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js";
4
+ import { AnimatedExpandedRow } from "./TableAnimatedExpandedRow.style.js";
5
+ const TableAnimatedExpandedRow = ({
6
+ expanded,
7
+ rowRef,
8
+ ...restProps
9
+ }) => {
10
+ const innerRowRef = useRef(null);
11
+ const composedRowRef = useComposedRefs(rowRef, innerRowRef);
12
+ useEffect(() => {
13
+ if (expanded) {
14
+ const timer = setTimeout(() => {
15
+ var _a;
16
+ return (_a = innerRowRef.current) == null ? void 0 : _a.scrollIntoView({
17
+ block: "nearest",
18
+ behavior: "smooth"
19
+ });
20
+ }, 500);
21
+ return () => clearTimeout(timer);
22
+ }
23
+ return void 0;
24
+ }, [expanded]);
25
+ return jsxRuntimeExports.jsx(AnimatedExpandedRow, {
26
+ rowRef: composedRowRef,
27
+ expanded,
28
+ ...restProps,
29
+ keepInDom: true
30
+ });
31
+ };
32
+ export {
33
+ TableAnimatedExpandedRow
34
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const _styled = require("styled-components");
4
+ const TableExpandedRow = require("./TableExpandedRow.cjs");
5
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
6
+ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
7
+ const AnimatedExpandedRow = _styled__default.default(TableExpandedRow.TableExpandedRow).withConfig({
8
+ displayName: "TableAnimatedExpandedRowstyle__AnimatedExpandedRow",
9
+ componentId: "sc-l3awb3-0"
10
+ })(["&&{display:grid;}visibility:hidden;grid-template-rows:0fr;transition:all 0.5s;&[data-expanded='true']{visibility:visible;grid-template-rows:1fr;}"]);
11
+ exports.AnimatedExpandedRow = AnimatedExpandedRow;
@@ -0,0 +1,2 @@
1
+ import { TableExpandedRow } from './TableExpandedRow';
2
+ export declare const AnimatedExpandedRow: typeof TableExpandedRow;
@@ -0,0 +1,9 @@
1
+ import _styled from "styled-components";
2
+ import { TableExpandedRow } from "./TableExpandedRow.js";
3
+ const AnimatedExpandedRow = _styled(TableExpandedRow).withConfig({
4
+ displayName: "TableAnimatedExpandedRowstyle__AnimatedExpandedRow",
5
+ componentId: "sc-l3awb3-0"
6
+ })(["&&{display:grid;}visibility:hidden;grid-template-rows:0fr;transition:all 0.5s;&[data-expanded='true']{visibility:visible;grid-template-rows:1fr;}"]);
7
+ export {
8
+ AnimatedExpandedRow
9
+ };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
4
+ const React = require("react");
5
+ const index = require("../../../node_modules/@radix-ui/react-compose-refs/dist/index.cjs");
6
+ const TableExpandedRow_style = require("./TableExpandedRow.style.cjs");
7
+ const TableExpandedRow = ({
8
+ row,
9
+ renderExpandedRow,
10
+ keepInDom,
11
+ expanded,
12
+ rowRef,
13
+ ...restProps
14
+ }) => {
15
+ const innerRowRef = React.useRef(null);
16
+ const composedRowRef = index.useComposedRefs(rowRef, innerRowRef);
17
+ const isExpanded = expanded ?? row.getIsExpanded();
18
+ React.useEffect(() => {
19
+ var _a;
20
+ if (isExpanded) {
21
+ (_a = innerRowRef.current) == null ? void 0 : _a.scrollIntoView({
22
+ block: "nearest",
23
+ behavior: "smooth"
24
+ });
25
+ }
26
+ }, [isExpanded]);
27
+ return keepInDom || isExpanded ? jsxRuntime.jsxRuntimeExports.jsx(TableExpandedRow_style.ExpandedRow, {
28
+ ref: composedRowRef,
29
+ ...restProps,
30
+ children: jsxRuntime.jsxRuntimeExports.jsx(TableExpandedRow_style.ExpandedCell, {
31
+ colSpan: row.getVisibleCells().length,
32
+ children: renderExpandedRow(row)
33
+ })
34
+ }) : null;
35
+ };
36
+ exports.TableExpandedRow = TableExpandedRow;
@@ -0,0 +1,2 @@
1
+ import { TableExpandedRowProps } from './TableExpandedRow.types';
2
+ export declare const TableExpandedRow: <T extends object>({ row, renderExpandedRow, keepInDom, expanded, rowRef, ...restProps }: TableExpandedRowProps<T>) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,36 @@
1
+ import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
2
+ import { useRef, useEffect } from "react";
3
+ import { useComposedRefs } from "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js";
4
+ import { ExpandedRow, ExpandedCell } from "./TableExpandedRow.style.js";
5
+ const TableExpandedRow = ({
6
+ row,
7
+ renderExpandedRow,
8
+ keepInDom,
9
+ expanded,
10
+ rowRef,
11
+ ...restProps
12
+ }) => {
13
+ const innerRowRef = useRef(null);
14
+ const composedRowRef = useComposedRefs(rowRef, innerRowRef);
15
+ const isExpanded = expanded ?? row.getIsExpanded();
16
+ useEffect(() => {
17
+ var _a;
18
+ if (isExpanded) {
19
+ (_a = innerRowRef.current) == null ? void 0 : _a.scrollIntoView({
20
+ block: "nearest",
21
+ behavior: "smooth"
22
+ });
23
+ }
24
+ }, [isExpanded]);
25
+ return keepInDom || isExpanded ? jsxRuntimeExports.jsx(ExpandedRow, {
26
+ ref: composedRowRef,
27
+ ...restProps,
28
+ children: jsxRuntimeExports.jsx(ExpandedCell, {
29
+ colSpan: row.getVisibleCells().length,
30
+ children: renderExpandedRow(row)
31
+ })
32
+ }) : null;
33
+ };
34
+ export {
35
+ TableExpandedRow
36
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const _styled = require("styled-components");
4
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
5
+ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
6
+ const ExpandedRow = _styled__default.default.tr.withConfig({
7
+ displayName: "TableExpandedRowstyle__ExpandedRow",
8
+ componentId: "sc-2hwl98-0"
9
+ })(["display:grid;width:100%;&[data-expanded='false']{display:none;}"]);
10
+ const ExpandedCell = _styled__default.default.td.withConfig({
11
+ displayName: "TableExpandedRowstyle__ExpandedCell",
12
+ componentId: "sc-2hwl98-1"
13
+ })(["width:100%;padding:0;overflow:hidden;"]);
14
+ exports.ExpandedCell = ExpandedCell;
15
+ exports.ExpandedRow = ExpandedRow;
@@ -0,0 +1,2 @@
1
+ export declare const ExpandedRow: import("styled-components").StyledComponent<"tr", any, {}, never>;
2
+ export declare const ExpandedCell: import("styled-components").StyledComponent<"td", any, {}, never>;
@@ -0,0 +1,13 @@
1
+ import _styled from "styled-components";
2
+ const ExpandedRow = _styled.tr.withConfig({
3
+ displayName: "TableExpandedRowstyle__ExpandedRow",
4
+ componentId: "sc-2hwl98-0"
5
+ })(["display:grid;width:100%;&[data-expanded='false']{display:none;}"]);
6
+ const ExpandedCell = _styled.td.withConfig({
7
+ displayName: "TableExpandedRowstyle__ExpandedCell",
8
+ componentId: "sc-2hwl98-1"
9
+ })(["width:100%;padding:0;overflow:hidden;"]);
10
+ export {
11
+ ExpandedCell,
12
+ ExpandedRow
13
+ };
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ import { RowDefinition } from '../../Table.types';
3
+ export type TableExpandedRowProps<T extends object> = {
4
+ row: RowDefinition<T>;
5
+ renderExpandedRow: (row: RowDefinition<T>) => ReactNode;
6
+ keepInDom?: boolean;
7
+ expanded?: boolean;
8
+ rowRef?: Ref<HTMLTableRowElement>;
9
+ } & HTMLAttributes<HTMLTableRowElement>;
@@ -0,0 +1,3 @@
1
+ export * from './TableExpandedRow';
2
+ export * from './TableAnimatedExpandedRow';
3
+ export * from './TableExpandedRow.types';
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
4
+ const redisUiIcons = require("@redislabsdev/redis-ui-icons");
5
+ const Table_context = require("../../Table.context.cjs");
6
+ const TablePagination_style = require("./TablePagination.style.cjs");
7
+ const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
8
+ const TablePagination = ({
9
+ pageSizes = DEFAULT_PAGE_SIZES
10
+ }) => {
11
+ const {
12
+ table
13
+ } = Table_context.useTableContext();
14
+ if (!table._getPaginationRowModel) {
15
+ return null;
16
+ }
17
+ const {
18
+ pageIndex,
19
+ pageSize
20
+ } = table.getState().pagination;
21
+ const totalRowCount = table.getRowCount();
22
+ const pageCount = Math.max(table.getPageCount(), 1);
23
+ const handlePageSizeChange = (value) => {
24
+ table.setPageSize(Number(value));
25
+ };
26
+ const handlePageIndexChange = (index) => {
27
+ table.setPageIndex(index);
28
+ };
29
+ return jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PaginationRow, {
30
+ "data-role": "pagination",
31
+ children: jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, {
32
+ children: [jsxRuntime.jsxRuntimeExports.jsxs(TablePagination_style.CountInfo, {
33
+ children: ["Showing ", table.getRowModel().rows.length, " out of ", totalRowCount, " rows"]
34
+ }), jsxRuntime.jsxRuntimeExports.jsxs("div", {
35
+ style: {
36
+ display: "flex",
37
+ alignItems: "center",
38
+ gap: "1rem"
39
+ },
40
+ children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.ItemPerPageText, {
41
+ children: "Items per page:"
42
+ }), jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.Select, {
43
+ value: pageSize.toString(),
44
+ onChange: handlePageSizeChange,
45
+ disabled: pageSizes[0] > totalRowCount,
46
+ options: pageSizes.map(String).map((value) => ({
47
+ value
48
+ }))
49
+ })]
50
+ }), jsxRuntime.jsxRuntimeExports.jsxs(TablePagination_style.PaginationActions, {
51
+ children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PaginationIconButton, {
52
+ icon: redisUiIcons.DoubleChevronLeftIcon,
53
+ size: "S",
54
+ onClick: () => handlePageIndexChange(0),
55
+ disabled: pageIndex === 0
56
+ }), jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PaginationIconButton, {
57
+ icon: redisUiIcons.ChevronLeftIcon,
58
+ size: "S",
59
+ onClick: () => handlePageIndexChange(pageIndex - 1),
60
+ disabled: pageIndex === 0
61
+ }), jsxRuntime.jsxRuntimeExports.jsxs(TablePagination_style.PaginationIndexText, {
62
+ size: "S",
63
+ children: [pageIndex + 1, " of ", pageCount]
64
+ }), jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PaginationIconButton, {
65
+ icon: redisUiIcons.ChevronRightIcon,
66
+ size: "S",
67
+ onClick: () => handlePageIndexChange(pageIndex + 1),
68
+ disabled: pageIndex === pageCount - 1
69
+ }), jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PaginationIconButton, {
70
+ icon: redisUiIcons.DoubleChevronRightIcon,
71
+ size: "S",
72
+ onClick: () => handlePageIndexChange(pageCount - 1),
73
+ disabled: pageIndex === pageCount - 1
74
+ })]
75
+ }), jsxRuntime.jsxRuntimeExports.jsxs(TablePagination_style.PaginationActions, {
76
+ children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PageLabelText, {
77
+ children: "Page"
78
+ }), jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.Select, {
79
+ value: (pageIndex + 1).toString(),
80
+ onChange: (value) => handlePageIndexChange(Number(value) - 1),
81
+ options: Array.from({
82
+ length: pageCount
83
+ }, (_, i) => String(i + 1)).map((value) => ({
84
+ value
85
+ }))
86
+ }), jsxRuntime.jsxRuntimeExports.jsxs(TablePagination_style.TotalPagesText, {
87
+ children: ["of ", pageCount]
88
+ })]
89
+ })]
90
+ })
91
+ });
92
+ };
93
+ exports.default = TablePagination;
@@ -0,0 +1,4 @@
1
+ declare const TablePagination: ({ pageSizes }: {
2
+ pageSizes?: number[] | undefined;
3
+ }) => import("react/jsx-runtime").JSX.Element | null;
4
+ export default TablePagination;
@@ -0,0 +1,93 @@
1
+ import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
2
+ import { DoubleChevronLeftIcon, ChevronLeftIcon, ChevronRightIcon, DoubleChevronRightIcon } from "@redislabsdev/redis-ui-icons";
3
+ import { useTableContext } from "../../Table.context.js";
4
+ import { PaginationRow, CountInfo, ItemPerPageText, Select, PaginationActions, PaginationIconButton, PaginationIndexText, PageLabelText, TotalPagesText } from "./TablePagination.style.js";
5
+ const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
6
+ const TablePagination = ({
7
+ pageSizes = DEFAULT_PAGE_SIZES
8
+ }) => {
9
+ const {
10
+ table
11
+ } = useTableContext();
12
+ if (!table._getPaginationRowModel) {
13
+ return null;
14
+ }
15
+ const {
16
+ pageIndex,
17
+ pageSize
18
+ } = table.getState().pagination;
19
+ const totalRowCount = table.getRowCount();
20
+ const pageCount = Math.max(table.getPageCount(), 1);
21
+ const handlePageSizeChange = (value) => {
22
+ table.setPageSize(Number(value));
23
+ };
24
+ const handlePageIndexChange = (index) => {
25
+ table.setPageIndex(index);
26
+ };
27
+ return jsxRuntimeExports.jsx(PaginationRow, {
28
+ "data-role": "pagination",
29
+ children: jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
30
+ children: [jsxRuntimeExports.jsxs(CountInfo, {
31
+ children: ["Showing ", table.getRowModel().rows.length, " out of ", totalRowCount, " rows"]
32
+ }), jsxRuntimeExports.jsxs("div", {
33
+ style: {
34
+ display: "flex",
35
+ alignItems: "center",
36
+ gap: "1rem"
37
+ },
38
+ children: [jsxRuntimeExports.jsx(ItemPerPageText, {
39
+ children: "Items per page:"
40
+ }), jsxRuntimeExports.jsx(Select, {
41
+ value: pageSize.toString(),
42
+ onChange: handlePageSizeChange,
43
+ disabled: pageSizes[0] > totalRowCount,
44
+ options: pageSizes.map(String).map((value) => ({
45
+ value
46
+ }))
47
+ })]
48
+ }), jsxRuntimeExports.jsxs(PaginationActions, {
49
+ children: [jsxRuntimeExports.jsx(PaginationIconButton, {
50
+ icon: DoubleChevronLeftIcon,
51
+ size: "S",
52
+ onClick: () => handlePageIndexChange(0),
53
+ disabled: pageIndex === 0
54
+ }), jsxRuntimeExports.jsx(PaginationIconButton, {
55
+ icon: ChevronLeftIcon,
56
+ size: "S",
57
+ onClick: () => handlePageIndexChange(pageIndex - 1),
58
+ disabled: pageIndex === 0
59
+ }), jsxRuntimeExports.jsxs(PaginationIndexText, {
60
+ size: "S",
61
+ children: [pageIndex + 1, " of ", pageCount]
62
+ }), jsxRuntimeExports.jsx(PaginationIconButton, {
63
+ icon: ChevronRightIcon,
64
+ size: "S",
65
+ onClick: () => handlePageIndexChange(pageIndex + 1),
66
+ disabled: pageIndex === pageCount - 1
67
+ }), jsxRuntimeExports.jsx(PaginationIconButton, {
68
+ icon: DoubleChevronRightIcon,
69
+ size: "S",
70
+ onClick: () => handlePageIndexChange(pageCount - 1),
71
+ disabled: pageIndex === pageCount - 1
72
+ })]
73
+ }), jsxRuntimeExports.jsxs(PaginationActions, {
74
+ children: [jsxRuntimeExports.jsx(PageLabelText, {
75
+ children: "Page"
76
+ }), jsxRuntimeExports.jsx(Select, {
77
+ value: (pageIndex + 1).toString(),
78
+ onChange: (value) => handlePageIndexChange(Number(value) - 1),
79
+ options: Array.from({
80
+ length: pageCount
81
+ }, (_, i) => String(i + 1)).map((value) => ({
82
+ value
83
+ }))
84
+ }), jsxRuntimeExports.jsxs(TotalPagesText, {
85
+ children: ["of ", pageCount]
86
+ })]
87
+ })]
88
+ })
89
+ });
90
+ };
91
+ export {
92
+ TablePagination as default
93
+ };
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const _styled = require("styled-components");
4
+ const redisUiStyles = require("@redislabsdev/redis-ui-styles");
5
+ const redisUiComponents = require("@redislabsdev/redis-ui-components");
6
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
7
+ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
8
+ const PaginationIconButton = _styled__default.default(redisUiComponents.IconButton).withConfig({
9
+ displayName: "TablePaginationstyle__PaginationIconButton",
10
+ componentId: "sc-ccqfi0-0"
11
+ })(["color:", ";&:disabled{color:", ";}"], () => redisUiStyles.useTheme().components.table.components.tablePagination.paginationIconButton.enabledColor, () => redisUiStyles.useTheme().components.table.components.tablePagination.paginationIconButton.disabledColor);
12
+ const CountInfo = _styled__default.default(redisUiComponents.Typography.Body).withConfig({
13
+ displayName: "TablePaginationstyle__CountInfo",
14
+ componentId: "sc-ccqfi0-1"
15
+ })(["display:flex;margin-right:auto;font-size:1.2rem;color:", ";"], () => redisUiStyles.useTheme().components.table.components.tablePagination.countInfoText.color);
16
+ const PaginationRow = _styled__default.default.div.withConfig({
17
+ displayName: "TablePaginationstyle__PaginationRow",
18
+ componentId: "sc-ccqfi0-2"
19
+ })(["display:flex;align-items:center;gap:3.2rem;width:100%;height:4.8rem;padding:0 1.2rem;justify-content:flex-end;border-top:1px solid ", ";"], () => redisUiStyles.useTheme().components.table.components.tablePagination.paginationRow.borderTop);
20
+ const Select = _styled__default.default(redisUiComponents.Select).withConfig({
21
+ displayName: "TablePaginationstyle__Select",
22
+ componentId: "sc-ccqfi0-3"
23
+ })(["height:2rem;padding:0 0.4rem;gap:0.4rem;span{font-size:1.2rem;line-height:initial;}"]);
24
+ const PaginationActions = _styled__default.default.div.withConfig({
25
+ displayName: "TablePaginationstyle__PaginationActions",
26
+ componentId: "sc-ccqfi0-4"
27
+ })(["display:flex;align-items:center;gap:0.4rem;"]);
28
+ const ItemPerPageText = _styled__default.default(redisUiComponents.Typography.Body).attrs({
29
+ size: "S"
30
+ }).withConfig({
31
+ displayName: "TablePaginationstyle__ItemPerPageText",
32
+ componentId: "sc-ccqfi0-5"
33
+ })(["color:", ";flex-shrink:0;"], () => redisUiStyles.useTheme().components.table.components.tablePagination.itemPerPageText.color);
34
+ const PaginationIndexText = _styled__default.default(redisUiComponents.Typography.Body).attrs({
35
+ size: "S"
36
+ }).withConfig({
37
+ displayName: "TablePaginationstyle__PaginationIndexText",
38
+ componentId: "sc-ccqfi0-6"
39
+ })(["color:", ";"], () => redisUiStyles.useTheme().components.table.components.tablePagination.paginationIndexText.color);
40
+ const PageLabelText = _styled__default.default(redisUiComponents.Typography.Body).attrs({
41
+ size: "S"
42
+ }).withConfig({
43
+ displayName: "TablePaginationstyle__PageLabelText",
44
+ componentId: "sc-ccqfi0-7"
45
+ })(["color:", ";flex-shrink:0;"], () => redisUiStyles.useTheme().components.table.components.tablePagination.pageLabelText.color);
46
+ const TotalPagesText = _styled__default.default(redisUiComponents.Typography.Body).attrs({
47
+ size: "S"
48
+ }).withConfig({
49
+ displayName: "TablePaginationstyle__TotalPagesText",
50
+ componentId: "sc-ccqfi0-8"
51
+ })(["color:", ";flex-shrink:0;"], () => redisUiStyles.useTheme().components.table.components.tablePagination.totalPagesText.color);
52
+ exports.CountInfo = CountInfo;
53
+ exports.ItemPerPageText = ItemPerPageText;
54
+ exports.PageLabelText = PageLabelText;
55
+ exports.PaginationActions = PaginationActions;
56
+ exports.PaginationIconButton = PaginationIconButton;
57
+ exports.PaginationIndexText = PaginationIndexText;
58
+ exports.PaginationRow = PaginationRow;
59
+ exports.Select = Select;
60
+ exports.TotalPagesText = TotalPagesText;
@@ -0,0 +1,50 @@
1
+ /// <reference types="react" />
2
+ export declare const PaginationIconButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@redislabsdev/redis-ui-components").IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
3
+ export declare const CountInfo: import("styled-components").StyledComponent<({ size, variant, component, ellipsis, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Typography/components/Body/Body.types").BodyProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
4
+ export declare const PaginationRow: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const Select: import("styled-components").StyledComponent<(<TValue extends string = string, TOption extends import("@redislabsdev/redis-ui-components").SelectOption<TValue> = import("@redislabsdev/redis-ui-components").SelectOption<TValue>>({ options, disabled, defaultOpen, open, onOpenChange, defaultValue, value, onChange, customCompare, error, valid, valueRender, searchable, placement, maxVisibleItems, placeholder, virtualized, contentWidth, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Compose/Compose.types").SelectComposeProps<TValue, TOption> & Omit<import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Compose/Compose.types").SelectTriggerComposeProps, "customContainer"> & import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Value/Value.types").SelectTriggerValueProps<TOption> & {
6
+ allowReset?: boolean | undefined;
7
+ loading?: boolean | undefined;
8
+ } & Omit<import("@redislabsdev/redis-ui-components/dist/Select/components/Content/Content.types").SelectContentProps<TOption>, "optionComponent" | "optionValueRender"> & import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Compose/Compose.types").RestSelectTriggerComposeProps) => import("react/jsx-runtime").JSX.Element) & {
9
+ Compose: <TValue_1 extends string = string, TOption_1 extends import("@redislabsdev/redis-ui-components").SelectOption<TValue_1> = import("@redislabsdev/redis-ui-components").SelectOption<TValue_1>>({ options, children, onOpenChange, defaultValue, value, onChange, customCompare, error, valid, disabled, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Compose/Compose.types").SelectComposeProps<TValue_1, TOption_1> & import("@redislabsdev/redis-ui-components/dist/Helpers/common.types").ComposeChildrenProps) => import("react/jsx-runtime").JSX.Element;
10
+ Trigger: (<TOption_2 extends import("@redislabsdev/redis-ui-components").SelectOption<string> = import("@redislabsdev/redis-ui-components").SelectOption<string>>({ placeholder, valueRender, allowReset, loading, ...props }: Omit<import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Compose/Compose.types").SelectTriggerComposeProps, "customContainer"> & import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Value/Value.types").SelectTriggerValueProps<TOption_2> & {
11
+ allowReset?: boolean | undefined;
12
+ loading?: boolean | undefined;
13
+ } & import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Compose/Compose.types").RestSelectTriggerComposeProps) => import("react/jsx-runtime").JSX.Element) & {
14
+ Compose: ({ customContainer, id, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Compose/Compose.types").SelectTriggerComposeProps & import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Compose/Compose.types").RestSelectTriggerComposeProps & import("@redislabsdev/redis-ui-components/dist/Helpers/common.types").ComposeChildrenProps) => import("react/jsx-runtime").JSX.Element;
15
+ Value: <TOption_3 extends import("@redislabsdev/redis-ui-components").SelectOption<string> = import("@redislabsdev/redis-ui-components").SelectOption<string>>({ placeholder, valueRender, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Value/Value.types").SelectTriggerValueProps<TOption_3> & import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Value/Value.types").RestSelectTriggerValueProps) => import("react/jsx-runtime").JSX.Element;
16
+ ResetButton: ({ children, title, ...restProps }: import("react").HTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element | null;
17
+ StatusIndicator: (props: import("@redislabsdev/redis-ui-icons/monochrome").MonochromeIconProps & Pick<import("react").HTMLAttributes<unknown>, "style" | "className">) => import("react/jsx-runtime").JSX.Element;
18
+ LoadingIndicator: ({ loading, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Inputs/components/LoadingIndicator/LoadingIndicator.types").LoadingIndicatorProps & import("@redislabsdev/redis-ui-components/dist/Inputs/components/LoadingIndicator/LoadingIndicator.types").RestLoadingIndicatorProps) => import("react/jsx-runtime").JSX.Element | null;
19
+ Arrow: ({ icon, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Trigger/components/Arrow/Arrow.types").TriggerArrowProps) => import("react/jsx-runtime").JSX.Element;
20
+ ErrorIcon: (props: import("@redislabsdev/redis-ui-icons/monochrome").MonochromeIconProps & Pick<import("react").HTMLAttributes<unknown>, "style" | "className">) => import("react/jsx-runtime").JSX.Element;
21
+ };
22
+ Content: (<TOption_4 extends import("@redislabsdev/redis-ui-components").SelectOption<string> = import("@redislabsdev/redis-ui-components").SelectOption<string>>({ searchable, optionValueRender, optionComponent, maxVisibleItems, virtualized, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Compose/Compose.types").SelectContentComposeProps & import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/OptionList/OptionList.types").OptionListProps<TOption_4> & {
23
+ searchable?: boolean | undefined;
24
+ } & import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Compose/Compose.types").RestSelectContentComposeProps) => import("react/jsx-runtime").JSX.Element) & {
25
+ Compose: ({ children, placement, contentWidth, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Compose/Compose.types").SelectContentComposeProps & import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Compose/Compose.types").RestSelectContentComposeProps & import("@redislabsdev/redis-ui-components/dist/Helpers/common.types").ComposeChildrenProps) => import("react/jsx-runtime").JSX.Element;
26
+ OptionList: <TOption_5 extends import("@redislabsdev/redis-ui-components").SelectOption<string> = import("@redislabsdev/redis-ui-components").SelectOption<string>>({ optionValueRender, optionComponent: OptionComponent, maxVisibleItems, virtualized, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/OptionList/OptionList.types").OptionListProps<TOption_5> & import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/OptionList/OptionList.types").RestOptionListProps) => import("react/jsx-runtime").JSX.Element;
27
+ Search: import("react").ForwardRefExoticComponent<Omit<import("@redislabsdev/redis-ui-components/dist/Inputs/components/Compose/TextCompose.types").TextInputComposeProps, "readOnly" | "parser" | "formatter"> & import("@redislabsdev/redis-ui-components/dist/Inputs/components/InputTag/InputTag.types").InputTagProps & import("@redislabsdev/redis-ui-components/dist/Inputs/components/LoadingIndicator/LoadingIndicator.types").LoadingIndicatorProps & import("@redislabsdev/redis-ui-components/dist/Inputs/components/ResetButton/ResetButton.types").ResetButtonProps & import("@redislabsdev/redis-ui-components").RestInputProps & import("react").RefAttributes<HTMLInputElement>>;
28
+ Footer: import("styled-components").StyledComponent<"div", any, {}, never>;
29
+ };
30
+ Option: (<TOption_6 extends import("@redislabsdev/redis-ui-components").SelectOption<string> = import("@redislabsdev/redis-ui-components").SelectOption<string>>({ option, content, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Option/components/Compose/Compose.types").SelectOptionComposeProps<TOption_6> & {
31
+ content?: import("react").ReactNode;
32
+ } & import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Option/components/Compose/Compose.types").RestSelectOptionComposeProps) => import("react/jsx-runtime").JSX.Element) & {
33
+ Compose: import("react").ForwardRefExoticComponent<import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Option/components/Compose/Compose.types").SelectOptionComposeProps<import("@redislabsdev/redis-ui-components").SelectOption<string>> & import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Option/components/Compose/Compose.types").RestSelectOptionComposeProps & import("@redislabsdev/redis-ui-components/dist/Helpers/common.types").ComposeChildrenProps & import("react").RefAttributes<HTMLDivElement>>;
34
+ Content: (props: import("@redislabsdev/redis-ui-components/dist/Helpers/common.types").ComposeChildrenProps & import("@redislabsdev/redis-ui-components/dist/Select/components/Content/components/Option/components/Content/Content.types").RestSelectOptionContentProps) => import("react/jsx-runtime").JSX.Element;
35
+ Indicator: ({ children, ...restProps }: import("@radix-ui/react-select").SelectItemIndicatorProps) => import("react/jsx-runtime").JSX.Element;
36
+ };
37
+ }, any, {}, never>;
38
+ export declare const PaginationActions: import("styled-components").StyledComponent<"div", any, {}, never>;
39
+ export declare const ItemPerPageText: import("styled-components").StyledComponent<({ size, variant, component, ellipsis, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Typography/components/Body/Body.types").BodyProps) => import("react/jsx-runtime").JSX.Element, any, {
40
+ size: "S";
41
+ }, "size">;
42
+ export declare const PaginationIndexText: import("styled-components").StyledComponent<({ size, variant, component, ellipsis, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Typography/components/Body/Body.types").BodyProps) => import("react/jsx-runtime").JSX.Element, any, {
43
+ size: "S";
44
+ }, "size">;
45
+ export declare const PageLabelText: import("styled-components").StyledComponent<({ size, variant, component, ellipsis, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Typography/components/Body/Body.types").BodyProps) => import("react/jsx-runtime").JSX.Element, any, {
46
+ size: "S";
47
+ }, "size">;
48
+ export declare const TotalPagesText: import("styled-components").StyledComponent<({ size, variant, component, ellipsis, ...restProps }: import("@redislabsdev/redis-ui-components/dist/Typography/components/Body/Body.types").BodyProps) => import("react/jsx-runtime").JSX.Element, any, {
49
+ size: "S";
50
+ }, "size">;
@@ -0,0 +1,58 @@
1
+ import _styled from "styled-components";
2
+ import { useTheme } from "@redislabsdev/redis-ui-styles";
3
+ import { IconButton, Typography, Select as Select$1 } from "@redislabsdev/redis-ui-components";
4
+ const PaginationIconButton = _styled(IconButton).withConfig({
5
+ displayName: "TablePaginationstyle__PaginationIconButton",
6
+ componentId: "sc-ccqfi0-0"
7
+ })(["color:", ";&:disabled{color:", ";}"], () => useTheme().components.table.components.tablePagination.paginationIconButton.enabledColor, () => useTheme().components.table.components.tablePagination.paginationIconButton.disabledColor);
8
+ const CountInfo = _styled(Typography.Body).withConfig({
9
+ displayName: "TablePaginationstyle__CountInfo",
10
+ componentId: "sc-ccqfi0-1"
11
+ })(["display:flex;margin-right:auto;font-size:1.2rem;color:", ";"], () => useTheme().components.table.components.tablePagination.countInfoText.color);
12
+ const PaginationRow = _styled.div.withConfig({
13
+ displayName: "TablePaginationstyle__PaginationRow",
14
+ componentId: "sc-ccqfi0-2"
15
+ })(["display:flex;align-items:center;gap:3.2rem;width:100%;height:4.8rem;padding:0 1.2rem;justify-content:flex-end;border-top:1px solid ", ";"], () => useTheme().components.table.components.tablePagination.paginationRow.borderTop);
16
+ const Select = _styled(Select$1).withConfig({
17
+ displayName: "TablePaginationstyle__Select",
18
+ componentId: "sc-ccqfi0-3"
19
+ })(["height:2rem;padding:0 0.4rem;gap:0.4rem;span{font-size:1.2rem;line-height:initial;}"]);
20
+ const PaginationActions = _styled.div.withConfig({
21
+ displayName: "TablePaginationstyle__PaginationActions",
22
+ componentId: "sc-ccqfi0-4"
23
+ })(["display:flex;align-items:center;gap:0.4rem;"]);
24
+ const ItemPerPageText = _styled(Typography.Body).attrs({
25
+ size: "S"
26
+ }).withConfig({
27
+ displayName: "TablePaginationstyle__ItemPerPageText",
28
+ componentId: "sc-ccqfi0-5"
29
+ })(["color:", ";flex-shrink:0;"], () => useTheme().components.table.components.tablePagination.itemPerPageText.color);
30
+ const PaginationIndexText = _styled(Typography.Body).attrs({
31
+ size: "S"
32
+ }).withConfig({
33
+ displayName: "TablePaginationstyle__PaginationIndexText",
34
+ componentId: "sc-ccqfi0-6"
35
+ })(["color:", ";"], () => useTheme().components.table.components.tablePagination.paginationIndexText.color);
36
+ const PageLabelText = _styled(Typography.Body).attrs({
37
+ size: "S"
38
+ }).withConfig({
39
+ displayName: "TablePaginationstyle__PageLabelText",
40
+ componentId: "sc-ccqfi0-7"
41
+ })(["color:", ";flex-shrink:0;"], () => useTheme().components.table.components.tablePagination.pageLabelText.color);
42
+ const TotalPagesText = _styled(Typography.Body).attrs({
43
+ size: "S"
44
+ }).withConfig({
45
+ displayName: "TablePaginationstyle__TotalPagesText",
46
+ componentId: "sc-ccqfi0-8"
47
+ })(["color:", ";flex-shrink:0;"], () => useTheme().components.table.components.tablePagination.totalPagesText.color);
48
+ export {
49
+ CountInfo,
50
+ ItemPerPageText,
51
+ PageLabelText,
52
+ PaginationActions,
53
+ PaginationIconButton,
54
+ PaginationIndexText,
55
+ PaginationRow,
56
+ Select,
57
+ TotalPagesText
58
+ };
@@ -0,0 +1,8 @@
1
+ export { default as Table } from './Table';
2
+ export { ShowOnRowHover } from './components/ShowOnRowHover/ShowOnRowHover.style';
3
+ export type { ColumnDefinition } from './Table.types';
4
+ export type { RowDefinition } from './Table.types';
5
+ export type { CellDefinition } from './Table.types';
6
+ export type { PaginationTypes } from './Table.types';
7
+ export type { SortingTypes } from './Table.types';
8
+ export { useTableContext } from './Table.context';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var jsxRuntime = { exports: {} };
4
+ exports.__module = jsxRuntime;
@@ -0,0 +1,4 @@
1
+ var jsxRuntime = { exports: {} };
2
+ export {
3
+ jsxRuntime as __module
4
+ };