analytica-frontend-lib 1.2.15 → 1.2.16

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.
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/Table/TablePagination.tsx
21
+ var TablePagination_exports = {};
22
+ __export(TablePagination_exports, {
23
+ default: () => TablePagination_default
24
+ });
25
+ module.exports = __toCommonJS(TablePagination_exports);
26
+ var import_phosphor_react = require("phosphor-react");
27
+
28
+ // src/utils/utils.ts
29
+ var import_clsx = require("clsx");
30
+ var import_tailwind_merge = require("tailwind-merge");
31
+ function cn(...inputs) {
32
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
33
+ }
34
+
35
+ // src/components/Table/TablePagination.tsx
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var TablePagination = ({
38
+ totalItems,
39
+ currentPage,
40
+ totalPages,
41
+ itemsPerPage,
42
+ itemsPerPageOptions = [10, 20, 50, 100],
43
+ onPageChange,
44
+ onItemsPerPageChange,
45
+ itemLabel = "itens",
46
+ className,
47
+ ...props
48
+ }) => {
49
+ const startItem = (currentPage - 1) * itemsPerPage + 1;
50
+ const handlePrevious = () => {
51
+ if (currentPage > 1) {
52
+ onPageChange(currentPage - 1);
53
+ }
54
+ };
55
+ const handleNext = () => {
56
+ if (currentPage < totalPages) {
57
+ onPageChange(currentPage + 1);
58
+ }
59
+ };
60
+ const handleItemsPerPageChange = (e) => {
61
+ if (onItemsPerPageChange) {
62
+ onItemsPerPageChange(Number(e.target.value));
63
+ }
64
+ };
65
+ const isFirstPage = currentPage === 1;
66
+ const isLastPage = currentPage === totalPages;
67
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
68
+ "div",
69
+ {
70
+ className: cn(
71
+ "flex flex-col sm:flex-row items-center gap-3 sm:gap-4 w-full bg-background-50 rounded-xl p-4",
72
+ "sm:justify-between",
73
+ className
74
+ ),
75
+ ...props,
76
+ children: [
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "font-normal text-xs leading-[14px] text-text-800", children: [
78
+ startItem,
79
+ " de ",
80
+ totalItems,
81
+ " ",
82
+ itemLabel
83
+ ] }),
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap sm:flex-nowrap items-center gap-2 sm:gap-4 justify-center sm:justify-start", children: [
85
+ onItemsPerPageChange && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
+ "select",
88
+ {
89
+ value: itemsPerPage,
90
+ onChange: handleItemsPerPageChange,
91
+ className: "w-24 h-9 py-0 px-3 pr-8 bg-background border border-border-300 rounded appearance-none cursor-pointer font-normal text-sm leading-[21px] text-text-900",
92
+ "aria-label": "Items por p\xE1gina",
93
+ children: itemsPerPageOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: option, children: [
94
+ option,
95
+ " itens"
96
+ ] }, option))
97
+ }
98
+ ),
99
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
+ import_phosphor_react.CaretDown,
101
+ {
102
+ size: 14,
103
+ weight: "regular",
104
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-background-600 pointer-events-none"
105
+ }
106
+ )
107
+ ] }),
108
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "font-normal text-xs leading-[14px] text-text-950", children: [
109
+ "P\xE1gina ",
110
+ currentPage,
111
+ " de ",
112
+ totalPages
113
+ ] }),
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
115
+ "button",
116
+ {
117
+ onClick: handlePrevious,
118
+ disabled: isFirstPage,
119
+ className: cn(
120
+ "flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all",
121
+ isFirstPage ? "opacity-50 cursor-not-allowed" : "hover:bg-primary-950/10 cursor-pointer"
122
+ ),
123
+ "aria-label": "P\xE1gina anterior",
124
+ children: [
125
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_phosphor_react.CaretLeft, { size: 12, weight: "bold", className: "text-primary-950" }),
126
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Anterior" })
127
+ ]
128
+ }
129
+ ),
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
131
+ "button",
132
+ {
133
+ onClick: handleNext,
134
+ disabled: isLastPage,
135
+ className: cn(
136
+ "flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all",
137
+ isLastPage ? "opacity-50 cursor-not-allowed" : "hover:bg-primary-950/10 cursor-pointer"
138
+ ),
139
+ "aria-label": "Pr\xF3xima p\xE1gina",
140
+ children: [
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Pr\xF3xima" }),
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_phosphor_react.CaretRight, { size: 12, weight: "bold", className: "text-primary-950" })
143
+ ]
144
+ }
145
+ )
146
+ ] })
147
+ ]
148
+ }
149
+ );
150
+ };
151
+ TablePagination.displayName = "TablePagination";
152
+ var TablePagination_default = TablePagination;
153
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Table/TablePagination.tsx","../../../src/utils/utils.ts"],"sourcesContent":["import { HTMLAttributes, ChangeEvent } from 'react';\nimport { CaretLeft, CaretRight, CaretDown } from 'phosphor-react';\nimport { cn } from '../../utils/utils';\n\nexport interface TablePaginationProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Total number of items\n */\n totalItems: number;\n /**\n * Current page (1-based)\n */\n currentPage: number;\n /**\n * Total number of pages\n */\n totalPages: number;\n /**\n * Items per page\n */\n itemsPerPage: number;\n /**\n * Available options for items per page\n * @default [10, 20, 50, 100]\n */\n itemsPerPageOptions?: number[];\n /**\n * Callback when page changes\n */\n onPageChange: (page: number) => void;\n /**\n * Callback when items per page changes\n */\n onItemsPerPageChange?: (itemsPerPage: number) => void;\n /**\n * Customizable label for items (e.g., \"escolas\", \"alunos\", \"atividades\")\n * @default \"itens\"\n */\n itemLabel?: string;\n}\n\n/**\n * Table pagination component with navigation controls and items per page selector\n *\n * @example\n * ```tsx\n * import { TablePagination } from 'analytica-frontend-lib';\n *\n * <TablePagination\n * totalItems={1000}\n * currentPage={1}\n * totalPages={10}\n * itemsPerPage={10}\n * itemsPerPageOptions={[10, 20, 50, 100]}\n * onPageChange={(page) => setCurrentPage(page)}\n * onItemsPerPageChange={(items) => setItemsPerPage(items)}\n * itemLabel=\"escolas\"\n * />\n * ```\n */\nconst TablePagination = ({\n totalItems,\n currentPage,\n totalPages,\n itemsPerPage,\n itemsPerPageOptions = [10, 20, 50, 100],\n onPageChange,\n onItemsPerPageChange,\n itemLabel = 'itens',\n className,\n ...props\n}: TablePaginationProps) => {\n const startItem = (currentPage - 1) * itemsPerPage + 1;\n\n const handlePrevious = () => {\n if (currentPage > 1) {\n onPageChange(currentPage - 1);\n }\n };\n\n const handleNext = () => {\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1);\n }\n };\n\n const handleItemsPerPageChange = (e: ChangeEvent<HTMLSelectElement>) => {\n if (onItemsPerPageChange) {\n onItemsPerPageChange(Number(e.target.value));\n }\n };\n\n const isFirstPage = currentPage === 1;\n const isLastPage = currentPage === totalPages;\n\n return (\n <div\n className={cn(\n 'flex flex-col sm:flex-row items-center gap-3 sm:gap-4 w-full bg-background-50 rounded-xl p-4',\n 'sm:justify-between',\n className\n )}\n {...props}\n >\n {/* Items count - isolado à esquerda no desktop */}\n <span className=\"font-normal text-xs leading-[14px] text-text-800\">\n {startItem} de {totalItems} {itemLabel}\n </span>\n\n {/* Grupo direita: selector + page info + botões */}\n <div className=\"flex flex-wrap sm:flex-nowrap items-center gap-2 sm:gap-4 justify-center sm:justify-start\">\n {/* Items per page selector */}\n {onItemsPerPageChange && (\n <div className=\"relative\">\n <select\n value={itemsPerPage}\n onChange={handleItemsPerPageChange}\n className=\"w-24 h-9 py-0 px-3 pr-8 bg-background border border-border-300 rounded appearance-none cursor-pointer font-normal text-sm leading-[21px] text-text-900\"\n aria-label=\"Items por página\"\n >\n {itemsPerPageOptions.map((option) => (\n <option key={option} value={option}>\n {option} itens\n </option>\n ))}\n </select>\n <CaretDown\n size={14}\n weight=\"regular\"\n className=\"absolute right-3 top-1/2 -translate-y-1/2 text-background-600 pointer-events-none\"\n />\n </div>\n )}\n\n {/* Page info */}\n <span className=\"font-normal text-xs leading-[14px] text-text-950\">\n Página {currentPage} de {totalPages}\n </span>\n\n {/* Previous button */}\n <button\n onClick={handlePrevious}\n disabled={isFirstPage}\n className={cn(\n 'flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all',\n isFirstPage\n ? 'opacity-50 cursor-not-allowed'\n : 'hover:bg-primary-950/10 cursor-pointer'\n )}\n aria-label=\"Página anterior\"\n >\n <CaretLeft size={12} weight=\"bold\" className=\"text-primary-950\" />\n <span className=\"font-medium text-xs leading-[14px] text-primary-950\">\n Anterior\n </span>\n </button>\n\n {/* Next button */}\n <button\n onClick={handleNext}\n disabled={isLastPage}\n className={cn(\n 'flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all',\n isLastPage\n ? 'opacity-50 cursor-not-allowed'\n : 'hover:bg-primary-950/10 cursor-pointer'\n )}\n aria-label=\"Próxima página\"\n >\n <span className=\"font-medium text-xs leading-[14px] text-primary-950\">\n Próxima\n </span>\n <CaretRight size={12} weight=\"bold\" className=\"text-primary-950\" />\n </button>\n </div>\n </div>\n );\n};\n\nTablePagination.displayName = 'TablePagination';\n\nexport default TablePagination;\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport { syncDropdownState } from './dropdown';\n\n/**\n * Retorna a cor hexadecimal com opacidade 0.3 (4d) se não estiver em dark mode.\n * Se estiver em dark mode, retorna a cor original.\n *\n * @param hexColor - Cor hexadecimal (ex: \"#0066b8\" ou \"0066b8\")\n * @param isDark - booleano indicando se está em dark mode\n * @returns string - cor hexadecimal com opacidade se necessário\n */\nexport function getSubjectColorWithOpacity(\n hexColor: string | undefined,\n isDark: boolean\n): string | undefined {\n if (!hexColor) return undefined;\n // Remove o '#' se existir\n let color = hexColor.replace(/^#/, '').toLowerCase();\n\n if (isDark) {\n // Se está em dark mode, sempre remove opacidade se existir\n if (color.length === 8) {\n color = color.slice(0, 6);\n }\n return `#${color}`;\n } else {\n // Se não está em dark mode (light mode)\n let resultColor: string;\n if (color.length === 6) {\n // Adiciona opacidade 0.3 (4D) para cores de 6 dígitos\n resultColor = `#${color}4d`;\n } else if (color.length === 8) {\n // Já tem opacidade, retorna como está\n resultColor = `#${color}`;\n } else {\n // Para outros tamanhos (3, 4, 5 dígitos), retorna como está\n resultColor = `#${color}`;\n }\n return resultColor;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4BAAiD;;;ACDjD,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADoGM;AA7CN,IAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,sBAAsB,CAAC,IAAI,IAAI,IAAI,GAAG;AAAA,EACtC;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,MAA4B;AAC1B,QAAM,aAAa,cAAc,KAAK,eAAe;AAErD,QAAM,iBAAiB,MAAM;AAC3B,QAAI,cAAc,GAAG;AACnB,mBAAa,cAAc,CAAC;AAAA,IAC9B;AAAA,EACF;AAEA,QAAM,aAAa,MAAM;AACvB,QAAI,cAAc,YAAY;AAC5B,mBAAa,cAAc,CAAC;AAAA,IAC9B;AAAA,EACF;AAEA,QAAM,2BAA2B,CAAC,MAAsC;AACtE,QAAI,sBAAsB;AACxB,2BAAqB,OAAO,EAAE,OAAO,KAAK,CAAC;AAAA,IAC7C;AAAA,EACF;AAEA,QAAM,cAAc,gBAAgB;AACpC,QAAM,aAAa,gBAAgB;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAGJ;AAAA,qDAAC,UAAK,WAAU,oDACb;AAAA;AAAA,UAAU;AAAA,UAAK;AAAA,UAAW;AAAA,UAAE;AAAA,WAC/B;AAAA,QAGA,6CAAC,SAAI,WAAU,6FAEZ;AAAA,kCACC,6CAAC,SAAI,WAAU,YACb;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,gBACP,UAAU;AAAA,gBACV,WAAU;AAAA,gBACV,cAAW;AAAA,gBAEV,8BAAoB,IAAI,CAAC,WACxB,6CAAC,YAAoB,OAAO,QACzB;AAAA;AAAA,kBAAO;AAAA,qBADG,MAEb,CACD;AAAA;AAAA,YACH;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAM;AAAA,gBACN,QAAO;AAAA,gBACP,WAAU;AAAA;AAAA,YACZ;AAAA,aACF;AAAA,UAIF,6CAAC,UAAK,WAAU,oDAAmD;AAAA;AAAA,YACzD;AAAA,YAAY;AAAA,YAAK;AAAA,aAC3B;AAAA,UAGA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,WAAW;AAAA,gBACT;AAAA,gBACA,cACI,kCACA;AAAA,cACN;AAAA,cACA,cAAW;AAAA,cAEX;AAAA,4DAAC,mCAAU,MAAM,IAAI,QAAO,QAAO,WAAU,oBAAmB;AAAA,gBAChE,4CAAC,UAAK,WAAU,uDAAsD,sBAEtE;AAAA;AAAA;AAAA,UACF;AAAA,UAGA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,WAAW;AAAA,gBACT;AAAA,gBACA,aACI,kCACA;AAAA,cACN;AAAA,cACA,cAAW;AAAA,cAEX;AAAA,4DAAC,UAAK,WAAU,uDAAsD,wBAEtE;AAAA,gBACA,4CAAC,oCAAW,MAAM,IAAI,QAAO,QAAO,WAAU,oBAAmB;AAAA;AAAA;AAAA,UACnE;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAE9B,IAAO,0BAAQ;","names":[]}
@@ -0,0 +1,132 @@
1
+ // src/components/Table/TablePagination.tsx
2
+ import { CaretLeft, CaretRight, CaretDown } from "phosphor-react";
3
+
4
+ // src/utils/utils.ts
5
+ import { clsx } from "clsx";
6
+ import { twMerge } from "tailwind-merge";
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+
11
+ // src/components/Table/TablePagination.tsx
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ var TablePagination = ({
14
+ totalItems,
15
+ currentPage,
16
+ totalPages,
17
+ itemsPerPage,
18
+ itemsPerPageOptions = [10, 20, 50, 100],
19
+ onPageChange,
20
+ onItemsPerPageChange,
21
+ itemLabel = "itens",
22
+ className,
23
+ ...props
24
+ }) => {
25
+ const startItem = (currentPage - 1) * itemsPerPage + 1;
26
+ const handlePrevious = () => {
27
+ if (currentPage > 1) {
28
+ onPageChange(currentPage - 1);
29
+ }
30
+ };
31
+ const handleNext = () => {
32
+ if (currentPage < totalPages) {
33
+ onPageChange(currentPage + 1);
34
+ }
35
+ };
36
+ const handleItemsPerPageChange = (e) => {
37
+ if (onItemsPerPageChange) {
38
+ onItemsPerPageChange(Number(e.target.value));
39
+ }
40
+ };
41
+ const isFirstPage = currentPage === 1;
42
+ const isLastPage = currentPage === totalPages;
43
+ return /* @__PURE__ */ jsxs(
44
+ "div",
45
+ {
46
+ className: cn(
47
+ "flex flex-col sm:flex-row items-center gap-3 sm:gap-4 w-full bg-background-50 rounded-xl p-4",
48
+ "sm:justify-between",
49
+ className
50
+ ),
51
+ ...props,
52
+ children: [
53
+ /* @__PURE__ */ jsxs("span", { className: "font-normal text-xs leading-[14px] text-text-800", children: [
54
+ startItem,
55
+ " de ",
56
+ totalItems,
57
+ " ",
58
+ itemLabel
59
+ ] }),
60
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap sm:flex-nowrap items-center gap-2 sm:gap-4 justify-center sm:justify-start", children: [
61
+ onItemsPerPageChange && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
62
+ /* @__PURE__ */ jsx(
63
+ "select",
64
+ {
65
+ value: itemsPerPage,
66
+ onChange: handleItemsPerPageChange,
67
+ className: "w-24 h-9 py-0 px-3 pr-8 bg-background border border-border-300 rounded appearance-none cursor-pointer font-normal text-sm leading-[21px] text-text-900",
68
+ "aria-label": "Items por p\xE1gina",
69
+ children: itemsPerPageOptions.map((option) => /* @__PURE__ */ jsxs("option", { value: option, children: [
70
+ option,
71
+ " itens"
72
+ ] }, option))
73
+ }
74
+ ),
75
+ /* @__PURE__ */ jsx(
76
+ CaretDown,
77
+ {
78
+ size: 14,
79
+ weight: "regular",
80
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-background-600 pointer-events-none"
81
+ }
82
+ )
83
+ ] }),
84
+ /* @__PURE__ */ jsxs("span", { className: "font-normal text-xs leading-[14px] text-text-950", children: [
85
+ "P\xE1gina ",
86
+ currentPage,
87
+ " de ",
88
+ totalPages
89
+ ] }),
90
+ /* @__PURE__ */ jsxs(
91
+ "button",
92
+ {
93
+ onClick: handlePrevious,
94
+ disabled: isFirstPage,
95
+ className: cn(
96
+ "flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all",
97
+ isFirstPage ? "opacity-50 cursor-not-allowed" : "hover:bg-primary-950/10 cursor-pointer"
98
+ ),
99
+ "aria-label": "P\xE1gina anterior",
100
+ children: [
101
+ /* @__PURE__ */ jsx(CaretLeft, { size: 12, weight: "bold", className: "text-primary-950" }),
102
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Anterior" })
103
+ ]
104
+ }
105
+ ),
106
+ /* @__PURE__ */ jsxs(
107
+ "button",
108
+ {
109
+ onClick: handleNext,
110
+ disabled: isLastPage,
111
+ className: cn(
112
+ "flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all",
113
+ isLastPage ? "opacity-50 cursor-not-allowed" : "hover:bg-primary-950/10 cursor-pointer"
114
+ ),
115
+ "aria-label": "Pr\xF3xima p\xE1gina",
116
+ children: [
117
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Pr\xF3xima" }),
118
+ /* @__PURE__ */ jsx(CaretRight, { size: 12, weight: "bold", className: "text-primary-950" })
119
+ ]
120
+ }
121
+ )
122
+ ] })
123
+ ]
124
+ }
125
+ );
126
+ };
127
+ TablePagination.displayName = "TablePagination";
128
+ var TablePagination_default = TablePagination;
129
+ export {
130
+ TablePagination_default as default
131
+ };
132
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Table/TablePagination.tsx","../../../src/utils/utils.ts"],"sourcesContent":["import { HTMLAttributes, ChangeEvent } from 'react';\nimport { CaretLeft, CaretRight, CaretDown } from 'phosphor-react';\nimport { cn } from '../../utils/utils';\n\nexport interface TablePaginationProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Total number of items\n */\n totalItems: number;\n /**\n * Current page (1-based)\n */\n currentPage: number;\n /**\n * Total number of pages\n */\n totalPages: number;\n /**\n * Items per page\n */\n itemsPerPage: number;\n /**\n * Available options for items per page\n * @default [10, 20, 50, 100]\n */\n itemsPerPageOptions?: number[];\n /**\n * Callback when page changes\n */\n onPageChange: (page: number) => void;\n /**\n * Callback when items per page changes\n */\n onItemsPerPageChange?: (itemsPerPage: number) => void;\n /**\n * Customizable label for items (e.g., \"escolas\", \"alunos\", \"atividades\")\n * @default \"itens\"\n */\n itemLabel?: string;\n}\n\n/**\n * Table pagination component with navigation controls and items per page selector\n *\n * @example\n * ```tsx\n * import { TablePagination } from 'analytica-frontend-lib';\n *\n * <TablePagination\n * totalItems={1000}\n * currentPage={1}\n * totalPages={10}\n * itemsPerPage={10}\n * itemsPerPageOptions={[10, 20, 50, 100]}\n * onPageChange={(page) => setCurrentPage(page)}\n * onItemsPerPageChange={(items) => setItemsPerPage(items)}\n * itemLabel=\"escolas\"\n * />\n * ```\n */\nconst TablePagination = ({\n totalItems,\n currentPage,\n totalPages,\n itemsPerPage,\n itemsPerPageOptions = [10, 20, 50, 100],\n onPageChange,\n onItemsPerPageChange,\n itemLabel = 'itens',\n className,\n ...props\n}: TablePaginationProps) => {\n const startItem = (currentPage - 1) * itemsPerPage + 1;\n\n const handlePrevious = () => {\n if (currentPage > 1) {\n onPageChange(currentPage - 1);\n }\n };\n\n const handleNext = () => {\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1);\n }\n };\n\n const handleItemsPerPageChange = (e: ChangeEvent<HTMLSelectElement>) => {\n if (onItemsPerPageChange) {\n onItemsPerPageChange(Number(e.target.value));\n }\n };\n\n const isFirstPage = currentPage === 1;\n const isLastPage = currentPage === totalPages;\n\n return (\n <div\n className={cn(\n 'flex flex-col sm:flex-row items-center gap-3 sm:gap-4 w-full bg-background-50 rounded-xl p-4',\n 'sm:justify-between',\n className\n )}\n {...props}\n >\n {/* Items count - isolado à esquerda no desktop */}\n <span className=\"font-normal text-xs leading-[14px] text-text-800\">\n {startItem} de {totalItems} {itemLabel}\n </span>\n\n {/* Grupo direita: selector + page info + botões */}\n <div className=\"flex flex-wrap sm:flex-nowrap items-center gap-2 sm:gap-4 justify-center sm:justify-start\">\n {/* Items per page selector */}\n {onItemsPerPageChange && (\n <div className=\"relative\">\n <select\n value={itemsPerPage}\n onChange={handleItemsPerPageChange}\n className=\"w-24 h-9 py-0 px-3 pr-8 bg-background border border-border-300 rounded appearance-none cursor-pointer font-normal text-sm leading-[21px] text-text-900\"\n aria-label=\"Items por página\"\n >\n {itemsPerPageOptions.map((option) => (\n <option key={option} value={option}>\n {option} itens\n </option>\n ))}\n </select>\n <CaretDown\n size={14}\n weight=\"regular\"\n className=\"absolute right-3 top-1/2 -translate-y-1/2 text-background-600 pointer-events-none\"\n />\n </div>\n )}\n\n {/* Page info */}\n <span className=\"font-normal text-xs leading-[14px] text-text-950\">\n Página {currentPage} de {totalPages}\n </span>\n\n {/* Previous button */}\n <button\n onClick={handlePrevious}\n disabled={isFirstPage}\n className={cn(\n 'flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all',\n isFirstPage\n ? 'opacity-50 cursor-not-allowed'\n : 'hover:bg-primary-950/10 cursor-pointer'\n )}\n aria-label=\"Página anterior\"\n >\n <CaretLeft size={12} weight=\"bold\" className=\"text-primary-950\" />\n <span className=\"font-medium text-xs leading-[14px] text-primary-950\">\n Anterior\n </span>\n </button>\n\n {/* Next button */}\n <button\n onClick={handleNext}\n disabled={isLastPage}\n className={cn(\n 'flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all',\n isLastPage\n ? 'opacity-50 cursor-not-allowed'\n : 'hover:bg-primary-950/10 cursor-pointer'\n )}\n aria-label=\"Próxima página\"\n >\n <span className=\"font-medium text-xs leading-[14px] text-primary-950\">\n Próxima\n </span>\n <CaretRight size={12} weight=\"bold\" className=\"text-primary-950\" />\n </button>\n </div>\n </div>\n );\n};\n\nTablePagination.displayName = 'TablePagination';\n\nexport default TablePagination;\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport { syncDropdownState } from './dropdown';\n\n/**\n * Retorna a cor hexadecimal com opacidade 0.3 (4d) se não estiver em dark mode.\n * Se estiver em dark mode, retorna a cor original.\n *\n * @param hexColor - Cor hexadecimal (ex: \"#0066b8\" ou \"0066b8\")\n * @param isDark - booleano indicando se está em dark mode\n * @returns string - cor hexadecimal com opacidade se necessário\n */\nexport function getSubjectColorWithOpacity(\n hexColor: string | undefined,\n isDark: boolean\n): string | undefined {\n if (!hexColor) return undefined;\n // Remove o '#' se existir\n let color = hexColor.replace(/^#/, '').toLowerCase();\n\n if (isDark) {\n // Se está em dark mode, sempre remove opacidade se existir\n if (color.length === 8) {\n color = color.slice(0, 6);\n }\n return `#${color}`;\n } else {\n // Se não está em dark mode (light mode)\n let resultColor: string;\n if (color.length === 6) {\n // Adiciona opacidade 0.3 (4D) para cores de 6 dígitos\n resultColor = `#${color}4d`;\n } else if (color.length === 8) {\n // Já tem opacidade, retorna como está\n resultColor = `#${color}`;\n } else {\n // Para outros tamanhos (3, 4, 5 dígitos), retorna como está\n resultColor = `#${color}`;\n }\n return resultColor;\n }\n}\n"],"mappings":";AACA,SAAS,WAAW,YAAY,iBAAiB;;;ACDjD,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADoGM,SASM,KATN;AA7CN,IAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,sBAAsB,CAAC,IAAI,IAAI,IAAI,GAAG;AAAA,EACtC;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,MAA4B;AAC1B,QAAM,aAAa,cAAc,KAAK,eAAe;AAErD,QAAM,iBAAiB,MAAM;AAC3B,QAAI,cAAc,GAAG;AACnB,mBAAa,cAAc,CAAC;AAAA,IAC9B;AAAA,EACF;AAEA,QAAM,aAAa,MAAM;AACvB,QAAI,cAAc,YAAY;AAC5B,mBAAa,cAAc,CAAC;AAAA,IAC9B;AAAA,EACF;AAEA,QAAM,2BAA2B,CAAC,MAAsC;AACtE,QAAI,sBAAsB;AACxB,2BAAqB,OAAO,EAAE,OAAO,KAAK,CAAC;AAAA,IAC7C;AAAA,EACF;AAEA,QAAM,cAAc,gBAAgB;AACpC,QAAM,aAAa,gBAAgB;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAGJ;AAAA,6BAAC,UAAK,WAAU,oDACb;AAAA;AAAA,UAAU;AAAA,UAAK;AAAA,UAAW;AAAA,UAAE;AAAA,WAC/B;AAAA,QAGA,qBAAC,SAAI,WAAU,6FAEZ;AAAA,kCACC,qBAAC,SAAI,WAAU,YACb;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,gBACP,UAAU;AAAA,gBACV,WAAU;AAAA,gBACV,cAAW;AAAA,gBAEV,8BAAoB,IAAI,CAAC,WACxB,qBAAC,YAAoB,OAAO,QACzB;AAAA;AAAA,kBAAO;AAAA,qBADG,MAEb,CACD;AAAA;AAAA,YACH;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAM;AAAA,gBACN,QAAO;AAAA,gBACP,WAAU;AAAA;AAAA,YACZ;AAAA,aACF;AAAA,UAIF,qBAAC,UAAK,WAAU,oDAAmD;AAAA;AAAA,YACzD;AAAA,YAAY;AAAA,YAAK;AAAA,aAC3B;AAAA,UAGA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,WAAW;AAAA,gBACT;AAAA,gBACA,cACI,kCACA;AAAA,cACN;AAAA,cACA,cAAW;AAAA,cAEX;AAAA,oCAAC,aAAU,MAAM,IAAI,QAAO,QAAO,WAAU,oBAAmB;AAAA,gBAChE,oBAAC,UAAK,WAAU,uDAAsD,sBAEtE;AAAA;AAAA;AAAA,UACF;AAAA,UAGA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,WAAW;AAAA,gBACT;AAAA,gBACA,aACI,kCACA;AAAA,cACN;AAAA,cACA,cAAW;AAAA,cAEX;AAAA,oCAAC,UAAK,WAAU,uDAAsD,wBAEtE;AAAA,gBACA,oBAAC,cAAW,MAAM,IAAI,QAAO,QAAO,WAAU,oBAAmB;AAAA;AAAA;AAAA,UACnE;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAE9B,IAAO,0BAAQ;","names":[]}
@@ -1,5 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ThHTMLAttributes, TdHTMLAttributes } from 'react';
3
+ export { default as TablePagination, TablePaginationProps } from './TablePagination/index.mjs';
4
+ import 'react/jsx-runtime';
3
5
 
4
6
  type TableVariant = 'default' | 'borderless';
5
7
  type TableRowState = 'default' | 'selected' | 'invalid' | 'disabled';
@@ -1,5 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes, ThHTMLAttributes, TdHTMLAttributes } from 'react';
3
+ export { default as TablePagination, TablePaginationProps } from './TablePagination/index.js';
4
+ import 'react/jsx-runtime';
3
5
 
4
6
  type TableVariant = 'default' | 'borderless';
5
7
  type TableRowState = 'default' | 'selected' | 'invalid' | 'disabled';
@@ -26,6 +26,7 @@ __export(Table_exports, {
26
26
  TableFooter: () => TableFooter,
27
27
  TableHead: () => TableHead,
28
28
  TableHeader: () => TableHeader,
29
+ TablePagination: () => TablePagination_default,
29
30
  TableRow: () => TableRow,
30
31
  default: () => Table_default,
31
32
  useTableSort: () => useTableSort
@@ -41,7 +42,7 @@ function cn(...inputs) {
41
42
  }
42
43
 
43
44
  // src/components/Table/Table.tsx
44
- var import_phosphor_react = require("phosphor-react");
45
+ var import_phosphor_react2 = require("phosphor-react");
45
46
 
46
47
  // src/components/Text/Text.tsx
47
48
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -181,8 +182,128 @@ var Button = ({
181
182
  };
182
183
  var Button_default = Button;
183
184
 
184
- // src/components/Table/Table.tsx
185
+ // src/components/Table/TablePagination.tsx
186
+ var import_phosphor_react = require("phosphor-react");
185
187
  var import_jsx_runtime4 = require("react/jsx-runtime");
188
+ var TablePagination = ({
189
+ totalItems,
190
+ currentPage,
191
+ totalPages,
192
+ itemsPerPage,
193
+ itemsPerPageOptions = [10, 20, 50, 100],
194
+ onPageChange,
195
+ onItemsPerPageChange,
196
+ itemLabel = "itens",
197
+ className,
198
+ ...props
199
+ }) => {
200
+ const startItem = (currentPage - 1) * itemsPerPage + 1;
201
+ const handlePrevious = () => {
202
+ if (currentPage > 1) {
203
+ onPageChange(currentPage - 1);
204
+ }
205
+ };
206
+ const handleNext = () => {
207
+ if (currentPage < totalPages) {
208
+ onPageChange(currentPage + 1);
209
+ }
210
+ };
211
+ const handleItemsPerPageChange = (e) => {
212
+ if (onItemsPerPageChange) {
213
+ onItemsPerPageChange(Number(e.target.value));
214
+ }
215
+ };
216
+ const isFirstPage = currentPage === 1;
217
+ const isLastPage = currentPage === totalPages;
218
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
219
+ "div",
220
+ {
221
+ className: cn(
222
+ "flex flex-col sm:flex-row items-center gap-3 sm:gap-4 w-full bg-background-50 rounded-xl p-4",
223
+ "sm:justify-between",
224
+ className
225
+ ),
226
+ ...props,
227
+ children: [
228
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "font-normal text-xs leading-[14px] text-text-800", children: [
229
+ startItem,
230
+ " de ",
231
+ totalItems,
232
+ " ",
233
+ itemLabel
234
+ ] }),
235
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-wrap sm:flex-nowrap items-center gap-2 sm:gap-4 justify-center sm:justify-start", children: [
236
+ onItemsPerPageChange && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative", children: [
237
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
238
+ "select",
239
+ {
240
+ value: itemsPerPage,
241
+ onChange: handleItemsPerPageChange,
242
+ className: "w-24 h-9 py-0 px-3 pr-8 bg-background border border-border-300 rounded appearance-none cursor-pointer font-normal text-sm leading-[21px] text-text-900",
243
+ "aria-label": "Items por p\xE1gina",
244
+ children: itemsPerPageOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("option", { value: option, children: [
245
+ option,
246
+ " itens"
247
+ ] }, option))
248
+ }
249
+ ),
250
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
251
+ import_phosphor_react.CaretDown,
252
+ {
253
+ size: 14,
254
+ weight: "regular",
255
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-background-600 pointer-events-none"
256
+ }
257
+ )
258
+ ] }),
259
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "font-normal text-xs leading-[14px] text-text-950", children: [
260
+ "P\xE1gina ",
261
+ currentPage,
262
+ " de ",
263
+ totalPages
264
+ ] }),
265
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
266
+ "button",
267
+ {
268
+ onClick: handlePrevious,
269
+ disabled: isFirstPage,
270
+ className: cn(
271
+ "flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all",
272
+ isFirstPage ? "opacity-50 cursor-not-allowed" : "hover:bg-primary-950/10 cursor-pointer"
273
+ ),
274
+ "aria-label": "P\xE1gina anterior",
275
+ children: [
276
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react.CaretLeft, { size: 12, weight: "bold", className: "text-primary-950" }),
277
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Anterior" })
278
+ ]
279
+ }
280
+ ),
281
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
282
+ "button",
283
+ {
284
+ onClick: handleNext,
285
+ disabled: isLastPage,
286
+ className: cn(
287
+ "flex flex-row justify-center items-center py-2 px-4 gap-2 rounded-3xl transition-all",
288
+ isLastPage ? "opacity-50 cursor-not-allowed" : "hover:bg-primary-950/10 cursor-pointer"
289
+ ),
290
+ "aria-label": "Pr\xF3xima p\xE1gina",
291
+ children: [
292
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Pr\xF3xima" }),
293
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react.CaretRight, { size: 12, weight: "bold", className: "text-primary-950" })
294
+ ]
295
+ }
296
+ )
297
+ ] })
298
+ ]
299
+ }
300
+ );
301
+ };
302
+ TablePagination.displayName = "TablePagination";
303
+ var TablePagination_default = TablePagination;
304
+
305
+ // src/components/Table/Table.tsx
306
+ var import_jsx_runtime5 = require("react/jsx-runtime");
186
307
  function useTableSort(data, options = {}) {
187
308
  const { syncWithUrl = false } = options;
188
309
  const getInitialState = () => {
@@ -299,7 +420,7 @@ var Table = (0, import_react.forwardRef)(
299
420
  const showNoSearchResult = hasSearchTerm && isTableBodyEmpty;
300
421
  const showEmptyState = !hasSearchTerm && isTableBodyEmpty;
301
422
  if (showNoSearchResult) {
302
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
423
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
303
424
  "div",
304
425
  {
305
426
  className: cn(
@@ -307,7 +428,7 @@ var Table = (0, import_react.forwardRef)(
307
428
  variant === "default" && "border border-border-200 rounded-xl"
308
429
  ),
309
430
  children: [
310
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
431
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
311
432
  "table",
312
433
  {
313
434
  ref,
@@ -324,16 +445,16 @@ var Table = (0, import_react.forwardRef)(
324
445
  })
325
446
  }
326
447
  ),
327
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "py-8 flex justify-center", children: noSearchResultImage ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
448
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "py-8 flex justify-center", children: noSearchResultImage ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
328
449
  NoSearchResult_default,
329
450
  {
330
451
  image: noSearchResultImage,
331
452
  title: noSearchResultTitle,
332
453
  description: noSearchResultDescription
333
454
  }
334
- ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "text-center", children: [
335
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-text-600 text-lg font-semibold mb-2", children: noSearchResultTitle }),
336
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-text-500 text-sm", children: noSearchResultDescription })
455
+ ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "text-center", children: [
456
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-600 text-lg font-semibold mb-2", children: noSearchResultTitle }),
457
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-500 text-sm", children: noSearchResultDescription })
337
458
  ] }) })
338
459
  ]
339
460
  }
@@ -342,9 +463,9 @@ var Table = (0, import_react.forwardRef)(
342
463
  const modifiedChildren = import_react.Children.map(children, (child) => {
343
464
  if ((0, import_react.isValidElement)(child) && child.type === TableBody && showEmptyState) {
344
465
  return (0, import_react.cloneElement)(child, {
345
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TableRow, { variant, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TableCell, { colSpan: columnCount, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 gap-4", children: [
346
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-text-600 text-base font-normal", children: emptyStateMessage }),
347
- onEmptyStateButtonClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
466
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableRow, { variant, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableCell, { colSpan: columnCount, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 gap-4", children: [
467
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-600 text-base font-normal", children: emptyStateMessage }),
468
+ onEmptyStateButtonClick && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
348
469
  Button_default,
349
470
  {
350
471
  variant: "solid",
@@ -359,14 +480,14 @@ var Table = (0, import_react.forwardRef)(
359
480
  }
360
481
  return child;
361
482
  });
362
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
483
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
363
484
  "div",
364
485
  {
365
486
  className: cn(
366
487
  "relative w-full overflow-x-auto",
367
488
  variant === "default" && "border border-border-200 rounded-xl"
368
489
  ),
369
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
490
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
370
491
  "table",
371
492
  {
372
493
  ref,
@@ -378,7 +499,7 @@ var Table = (0, import_react.forwardRef)(
378
499
  children: [
379
500
  !import_react.Children.toArray(children).some(
380
501
  (child) => (0, import_react.isValidElement)(child) && child.type === TableCaption
381
- ) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("caption", { className: "sr-only", children: "My Table" }),
502
+ ) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("caption", { className: "sr-only", children: "My Table" }),
382
503
  modifiedChildren
383
504
  ]
384
505
  }
@@ -388,7 +509,7 @@ var Table = (0, import_react.forwardRef)(
388
509
  }
389
510
  );
390
511
  Table.displayName = "Table";
391
- var TableHeader = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
512
+ var TableHeader = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
392
513
  "thead",
393
514
  {
394
515
  ref,
@@ -398,7 +519,7 @@ var TableHeader = (0, import_react.forwardRef)(({ className, ...props }, ref) =>
398
519
  ));
399
520
  TableHeader.displayName = "TableHeader";
400
521
  var TableBody = (0, import_react.forwardRef)(
401
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
522
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
402
523
  "tbody",
403
524
  {
404
525
  ref,
@@ -409,7 +530,7 @@ var TableBody = (0, import_react.forwardRef)(
409
530
  );
410
531
  TableBody.displayName = "TableBody";
411
532
  var TableFooter = (0, import_react.forwardRef)(
412
- ({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
533
+ ({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
413
534
  "tfoot",
414
535
  {
415
536
  ref,
@@ -449,7 +570,7 @@ var TableRow = (0, import_react.forwardRef)(
449
570
  className,
450
571
  ...props
451
572
  }, ref) => {
452
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
573
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
453
574
  "tr",
454
575
  {
455
576
  ref,
@@ -481,7 +602,7 @@ var TableHead = (0, import_react.forwardRef)(
481
602
  onSort();
482
603
  }
483
604
  };
484
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
605
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
485
606
  "th",
486
607
  {
487
608
  ref,
@@ -492,11 +613,11 @@ var TableHead = (0, import_react.forwardRef)(
492
613
  ),
493
614
  onClick: handleClick,
494
615
  ...props,
495
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
616
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2", children: [
496
617
  children,
497
- sortable && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-col", children: [
498
- sortDirection === "asc" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react.CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
499
- sortDirection === "desc" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react.CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
618
+ sortable && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col", children: [
619
+ sortDirection === "asc" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
620
+ sortDirection === "desc" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
500
621
  ] })
501
622
  ] })
502
623
  }
@@ -504,7 +625,7 @@ var TableHead = (0, import_react.forwardRef)(
504
625
  }
505
626
  );
506
627
  TableHead.displayName = "TableHead";
507
- var TableCell = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
628
+ var TableCell = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
508
629
  "td",
509
630
  {
510
631
  ref,
@@ -516,7 +637,7 @@ var TableCell = (0, import_react.forwardRef)(({ className, ...props }, ref) => /
516
637
  }
517
638
  ));
518
639
  TableCell.displayName = "TableCell";
519
- var TableCaption = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
640
+ var TableCaption = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
520
641
  "caption",
521
642
  {
522
643
  ref,
@@ -537,6 +658,7 @@ var Table_default = Table;
537
658
  TableFooter,
538
659
  TableHead,
539
660
  TableHeader,
661
+ TablePagination,
540
662
  TableRow,
541
663
  useTableSort
542
664
  });