Skip to content

Commit

Permalink
chore: migrate vui-source changes to v3.9.0 (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrderyk authored Jan 8, 2025
1 parent dd59675 commit 6f780b2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vectara/vectara-ui",
"version": "3.8.1",
"version": "3.9.0",
"homepage": "https://vectara.github.io/vectara-ui/",
"description": "Vectara's design system, codified as a React and Sass component library",
"author": "Vectara",
Expand Down
3 changes: 2 additions & 1 deletion src/docs/pages/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const Table = () => {
return "Name";
}
},
testId: "nameColumn",
testId: (person: Person) => `nameColumn-${person.id}`,
render: (person: Person) => (
<div>
<div>
Expand Down Expand Up @@ -322,6 +322,7 @@ export const Table = () => {
content={content}
actions={actions}
actionsTestIdProvider={(person: Person) => `actions-${person.id}`}
reloadTestId="reloadButton"
pagination={pagination}
selection={selection}
onSort={(column, direction) => console.log("Sort", column, direction)}
Expand Down
8 changes: 5 additions & 3 deletions src/lib/components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Column<T> = {
header: TableHeaderCellProps["header"];
render?: (row: T, rowIndex: number) => React.ReactNode;
className?: string;
testId?: string;
testId?: string | ((row: T) => string);
};

type Props<T> = {
Expand All @@ -44,6 +44,7 @@ type Props<T> = {
rows: T[];
actions?: TableRowActionsProps<T>["actions"];
actionsTestIdProvider?: (row: T) => string;
reloadTestId?: string;
pagination?: Pagination | Pager;
selection?: Selection<T>;
search?: Search;
Expand Down Expand Up @@ -83,6 +84,7 @@ export const VuiTable = <T extends Row>({
rows,
actions,
actionsTestIdProvider,
reloadTestId,
pagination,
selection,
search,
Expand Down Expand Up @@ -194,7 +196,7 @@ export const VuiTable = <T extends Row>({
const { name, render, className, testId } = column;

return (
<td key={name} className={className} data-testid={testId}>
<td key={name} className={className} data-testid={typeof testId === "function" ? testId(row) : testId}>
<VuiTableCell>{render ? render(row, rowIndex) : row[column.name]}</VuiTableCell>
</td>
);
Expand Down Expand Up @@ -257,7 +259,7 @@ export const VuiTable = <T extends Row>({
{onReload && (
<VuiFlexItem grow={1} shrink={false}>
<VuiFlexContainer justifyContent="end">
<VuiButtonSecondary color="neutral" onClick={() => onReload()}>
<VuiButtonSecondary color="neutral" onClick={() => onReload()} data-testid={reloadTestId}>
Reload
</VuiButtonSecondary>
</VuiFlexContainer>
Expand Down
4 changes: 4 additions & 0 deletions src/lib/styles/_reset.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
body {
font-size: 14px;
}

body,
textarea {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
Expand Down

0 comments on commit 6f780b2

Please sign in to comment.