@usetheo/ui 0.35.0 → 0.35.1
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.
- package/dist/index.js +58 -45
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4935,53 +4935,66 @@ function DataTableDefaultBody(props) {
|
|
|
4935
4935
|
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: emptyState ?? /* @__PURE__ */ jsx(EmptyState, { title: "No data", description: "There's nothing here yet." }) });
|
|
4936
4936
|
}
|
|
4937
4937
|
const totalPages = pagination ? Math.ceil(sortedData.length / effectivePageSize) : 1;
|
|
4938
|
-
return
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4938
|
+
return (
|
|
4939
|
+
// `overflow-x-auto`: uma tabela mais larga que o contêiner ROLA dentro dele, em vez de vazar por
|
|
4940
|
+
// cima do resto da página. Medido no consumidor: 11 colunas produziam 1838 px dentro de 1486 px,
|
|
4941
|
+
// e a raiz era só `w-full` — então o excesso escapava e desconfigurava a tela inteira. Não era
|
|
4942
|
+
// defeito de uma tela: era desta raiz, e alcançava qualquer consumidor com colunas demais.
|
|
4943
|
+
//
|
|
4944
|
+
// A variante virtualizada já fazia isto; a não-virtualizada é que tinha ficado para trás.
|
|
4945
|
+
//
|
|
4946
|
+
// Efeito colateral declarado: com `overflow-x` diferente de `visible`, o CSS computa `overflow-y`
|
|
4947
|
+
// como `auto` — logo este `div` vira contexto de rolagem, e um `stickyHeader` passa a grudar nele
|
|
4948
|
+
// e não na viewport. Para o cabeçalho grudar de fato, o consumidor precisa dar altura máxima ao
|
|
4949
|
+
// contêiner (`className="max-h-[...]"`), que é o que torna a rolagem vertical real.
|
|
4950
|
+
/* @__PURE__ */ jsxs("div", { className: cn("w-full overflow-x-auto", className), children: [
|
|
4951
|
+
/* @__PURE__ */ jsxs(Table, { children: [
|
|
4952
|
+
/* @__PURE__ */ jsx(Table.Header, { className: stickyHeader ? "sticky top-0 z-10 bg-card" : void 0, children: /* @__PURE__ */ jsx(
|
|
4953
|
+
DataTableHeaderRow,
|
|
4954
|
+
{
|
|
4955
|
+
columns,
|
|
4956
|
+
sort,
|
|
4957
|
+
onSortClick: handleSort,
|
|
4958
|
+
hasExpandColumn: expandable !== void 0,
|
|
4959
|
+
hasActionsColumn: rowActions !== void 0
|
|
4960
|
+
}
|
|
4961
|
+
) }),
|
|
4962
|
+
/* @__PURE__ */ jsx(Table.Body, { children: visibleData.map((row) => {
|
|
4963
|
+
const key = rowKey(row);
|
|
4964
|
+
const expandedContent = expandable ? expandable(row) : null;
|
|
4965
|
+
const isExpandable = expandedContent !== null && expandedContent !== void 0;
|
|
4966
|
+
const isExpanded = expanded.has(key);
|
|
4967
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4968
|
+
/* @__PURE__ */ jsxs(Table.Row, { children: [
|
|
4969
|
+
expandable ? /* @__PURE__ */ jsx(Table.Cell, { children: isExpandable ? /* @__PURE__ */ jsx(
|
|
4970
|
+
"button",
|
|
4971
|
+
{
|
|
4972
|
+
type: "button",
|
|
4973
|
+
onClick: () => toggleExpand(key),
|
|
4974
|
+
"aria-expanded": isExpanded,
|
|
4975
|
+
"aria-controls": `expanded-${key}`,
|
|
4976
|
+
"aria-label": isExpanded ? "Collapse row" : "Expand row",
|
|
4977
|
+
className: "inline-flex items-center justify-center rounded-md p-0.5 hover:bg-muted",
|
|
4978
|
+
children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true", className: "size-4" }) : /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: "size-4" })
|
|
4979
|
+
}
|
|
4980
|
+
) : null }) : null,
|
|
4981
|
+
columns.map((col) => /* @__PURE__ */ jsx(Table.Cell, { align: col.align, className: col.className, children: renderCellContent(row, col) }, col.key)),
|
|
4982
|
+
rowActions ? /* @__PURE__ */ jsx(DataTableRowActionsCell, { children: rowActions(row) }) : null
|
|
4983
|
+
] }),
|
|
4984
|
+
isExpanded && isExpandable ? /* @__PURE__ */ jsx("tr", { id: `expanded-${key}`, children: /* @__PURE__ */ jsx("td", { colSpan: expandedColSpan, className: "bg-muted/30 p-4", children: expandedContent }) }) : null
|
|
4985
|
+
] }, key);
|
|
4986
|
+
}) })
|
|
4987
|
+
] }),
|
|
4988
|
+
pagination && totalPages > 1 ? /* @__PURE__ */ jsx("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsx(
|
|
4989
|
+
Pagination,
|
|
4942
4990
|
{
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
hasExpandColumn: expandable !== void 0,
|
|
4947
|
-
hasActionsColumn: rowActions !== void 0
|
|
4991
|
+
currentPage: currentPage + 1,
|
|
4992
|
+
totalPages,
|
|
4993
|
+
onPageChange: handlePageChange
|
|
4948
4994
|
}
|
|
4949
|
-
) })
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
const expandedContent = expandable ? expandable(row) : null;
|
|
4953
|
-
const isExpandable = expandedContent !== null && expandedContent !== void 0;
|
|
4954
|
-
const isExpanded = expanded.has(key);
|
|
4955
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4956
|
-
/* @__PURE__ */ jsxs(Table.Row, { children: [
|
|
4957
|
-
expandable ? /* @__PURE__ */ jsx(Table.Cell, { children: isExpandable ? /* @__PURE__ */ jsx(
|
|
4958
|
-
"button",
|
|
4959
|
-
{
|
|
4960
|
-
type: "button",
|
|
4961
|
-
onClick: () => toggleExpand(key),
|
|
4962
|
-
"aria-expanded": isExpanded,
|
|
4963
|
-
"aria-controls": `expanded-${key}`,
|
|
4964
|
-
"aria-label": isExpanded ? "Collapse row" : "Expand row",
|
|
4965
|
-
className: "inline-flex items-center justify-center rounded-md p-0.5 hover:bg-muted",
|
|
4966
|
-
children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { "aria-hidden": "true", className: "size-4" }) : /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: "size-4" })
|
|
4967
|
-
}
|
|
4968
|
-
) : null }) : null,
|
|
4969
|
-
columns.map((col) => /* @__PURE__ */ jsx(Table.Cell, { align: col.align, className: col.className, children: renderCellContent(row, col) }, col.key)),
|
|
4970
|
-
rowActions ? /* @__PURE__ */ jsx(DataTableRowActionsCell, { children: rowActions(row) }) : null
|
|
4971
|
-
] }),
|
|
4972
|
-
isExpanded && isExpandable ? /* @__PURE__ */ jsx("tr", { id: `expanded-${key}`, children: /* @__PURE__ */ jsx("td", { colSpan: expandedColSpan, className: "bg-muted/30 p-4", children: expandedContent }) }) : null
|
|
4973
|
-
] }, key);
|
|
4974
|
-
}) })
|
|
4975
|
-
] }),
|
|
4976
|
-
pagination && totalPages > 1 ? /* @__PURE__ */ jsx("div", { className: "mt-4 flex items-center justify-end", children: /* @__PURE__ */ jsx(
|
|
4977
|
-
Pagination,
|
|
4978
|
-
{
|
|
4979
|
-
currentPage: currentPage + 1,
|
|
4980
|
-
totalPages,
|
|
4981
|
-
onPageChange: handlePageChange
|
|
4982
|
-
}
|
|
4983
|
-
) }) : null
|
|
4984
|
-
] });
|
|
4995
|
+
) }) : null
|
|
4996
|
+
] })
|
|
4997
|
+
);
|
|
4985
4998
|
}
|
|
4986
4999
|
var PageShell = forwardRef(
|
|
4987
5000
|
({
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usetheo/ui",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.1",
|
|
4
4
|
"packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"description": "Violet Forge design system
|
|
7
|
+
"description": "Violet Forge design system \u2014 generic React components + primitives (the non-AI foundation of @theokit/ui).",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|