Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit b7701dc

Browse files
committed
Update typescript versions and enhance toolbar render functionality
This commit updates the TypeScript versions from 5.3.2 to 5.3.3 in several packages. Additionally, it enhances the startToolbar and endToolbar render functionality in the data-table.tsx file by allowing them to either receive a React Node, or a function returning one, thus providing more flexibility in their usage.
1 parent 11485e1 commit b7701dc

File tree

13 files changed

+464
-413
lines changed

13 files changed

+464
-413
lines changed

apps/docs/package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,42 @@
1717
"@codefixlabs/ui": "workspace:*",
1818
"@faker-js/faker": "^8.3.1",
1919
"@hookform/resolvers": "^3.3.2",
20-
"@storybook/addon-a11y": "^7.6.3",
21-
"@storybook/addon-essentials": "^7.6.3",
22-
"@storybook/addon-interactions": "^7.6.3",
23-
"@storybook/addon-links": "^7.6.3",
24-
"@storybook/blocks": "^7.6.3",
25-
"@storybook/manager-api": "^7.6.3",
26-
"@storybook/nextjs": "^7.6.3",
27-
"@storybook/react": "^7.6.3",
20+
"@storybook/addon-a11y": "^7.6.4",
21+
"@storybook/addon-essentials": "^7.6.4",
22+
"@storybook/addon-interactions": "^7.6.4",
23+
"@storybook/addon-links": "^7.6.4",
24+
"@storybook/blocks": "^7.6.4",
25+
"@storybook/manager-api": "^7.6.4",
26+
"@storybook/nextjs": "^7.6.4",
27+
"@storybook/react": "^7.6.4",
2828
"@storybook/testing-library": "^0.2.2",
29-
"@storybook/theming": "^7.6.3",
30-
"@storybook/types": "^7.6.3",
29+
"@storybook/theming": "^7.6.4",
30+
"@storybook/types": "^7.6.4",
3131
"@tanstack/react-table": "^8.10.7",
3232
"class-variance-authority": "^0.7.0",
3333
"date-fns": "^2.30.0",
3434
"lucide-react": "^0.294.0",
35-
"next": "^14.0.3",
35+
"next": "^14.0.4",
3636
"react": "^18.2.0",
3737
"react-day-picker": "^8.9.1",
3838
"react-dom": "^18.2.0",
3939
"react-hook-form": "^7.48.2",
40-
"storybook": "^7.6.3",
40+
"storybook": "^7.6.4",
4141
"tailwind-merge": "^2.1.0",
4242
"zod": "^3.22.4"
4343
},
4444
"devDependencies": {
4545
"@codefixlabs/tailwindcss": "workspace:*",
4646
"@codefixlabs/tsconfig": "workspace:*",
47-
"@next/eslint-plugin-next": "^14.0.3",
48-
"@types/node": "^20.10.3",
47+
"@next/eslint-plugin-next": "^14.0.4",
48+
"@types/node": "^20.10.4",
4949
"@types/react": "^18.2.42",
5050
"@types/react-dom": "^18.2.17",
5151
"autoprefixer": "^10.4.16",
52-
"chromatic": "^10.0.0",
52+
"chromatic": "^10.1.0",
5353
"eslint-config-codefixlabs": "workspace:*",
5454
"postcss": "^8.4.32",
5555
"tailwindcss": "^3.3.6",
56-
"typescript": "^5.3.2"
56+
"typescript": "^5.3.3"
5757
}
5858
}

apps/docs/src/stories/data-table/data-table.stories.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,15 @@ const data: Payment[] = Array.from({ length: 100 }, () => ({
153153
export const Basic: Story = {
154154
render: () => <DataTable columns={columns} data={data} pageCount={1} />,
155155
};
156+
157+
export const CustomToolbar: Story = {
158+
render: () => (
159+
<DataTable
160+
columns={columns}
161+
data={data}
162+
endToolbar={(table) => <div>World {table.getPageCount()}</div>}
163+
pageCount={1}
164+
startToolbar={<div>Hello</div>}
165+
/>
166+
),
167+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"prettier": "^3.1.0",
5555
"prettier-plugin-tailwindcss": "^0.5.9",
5656
"simple-git-hooks": "^2.9.0",
57-
"turbo": "^1.11.0"
57+
"turbo": "^1.11.1"
5858
},
5959
"packageManager": "[email protected]"
6060
}

packages/hooks/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/hooks
22

3+
## 0.1.25
4+
5+
### Patch Changes
6+
7+
- Update typescript versions and enhance toolbar render functionality
8+
39
## 0.1.24
410

511
### Patch Changes

packages/hooks/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefixlabs/hooks",
3-
"version": "0.1.24",
3+
"version": "0.1.25",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
@@ -43,7 +43,7 @@
4343
"@types/react": "^18.2.42",
4444
"eslint-config-codefixlabs": "workspace:*",
4545
"tsup": "^8.0.1",
46-
"typescript": "^5.3.2"
46+
"typescript": "^5.3.3"
4747
},
4848
"publishConfig": {
4949
"access": "public"

packages/lib/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/lib
22

3+
## 0.1.27
4+
5+
### Patch Changes
6+
7+
- Update typescript versions and enhance toolbar render functionality
8+
39
## 0.1.26
410

511
### Patch Changes

packages/lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefixlabs/lib",
3-
"version": "0.1.26",
3+
"version": "0.1.27",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
@@ -52,7 +52,7 @@
5252
"@types/react": "^18.2.42",
5353
"eslint-config-codefixlabs": "workspace:*",
5454
"tsup": "^8.0.1",
55-
"typescript": "^5.3.2"
55+
"typescript": "^5.3.3"
5656
},
5757
"publishConfig": {
5858
"access": "public"

packages/tailwindcss/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/tailwindcss
22

3+
## 0.1.33
4+
5+
### Patch Changes
6+
7+
- Update typescript versions and enhance toolbar render functionality
8+
39
## 0.1.32
410

511
### Patch Changes

packages/tailwindcss/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefixlabs/tailwindcss",
3-
"version": "0.1.32",
3+
"version": "0.1.33",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
@@ -42,7 +42,7 @@
4242
"@codefixlabs/tsconfig": "workspace:*",
4343
"eslint-config-codefixlabs": "workspace:*",
4444
"tsup": "^8.0.1",
45-
"typescript": "^5.3.2"
45+
"typescript": "^5.3.3"
4646
},
4747
"publishConfig": {
4848
"access": "public"

packages/ui/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @codefixlabs/ui
22

3+
## 0.1.64
4+
5+
### Patch Changes
6+
7+
- Update typescript versions and enhance toolbar render functionality
8+
- Updated dependencies
9+
- @codefixlabs/hooks@0.1.25
10+
- @codefixlabs/lib@0.1.27
11+
312
## 0.1.63
413

514
### Patch Changes

packages/ui/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefixlabs/ui",
3-
"version": "0.1.63",
3+
"version": "0.1.64",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
@@ -95,15 +95,15 @@
9595
"devDependencies": {
9696
"@codefixlabs/tailwindcss": "workspace:*",
9797
"@codefixlabs/tsconfig": "workspace:*",
98-
"@types/node": "^20.10.3",
98+
"@types/node": "^20.10.4",
9999
"@types/pluralize": "^0.0.33",
100100
"@types/react": "^18.2.42",
101101
"autoprefixer": "^10.4.16",
102102
"eslint-config-codefixlabs": "workspace:*",
103103
"postcss": "^8.4.32",
104104
"tailwindcss": "^3.3.6",
105105
"tsup": "^8.0.1",
106-
"typescript": "^5.3.2"
106+
"typescript": "^5.3.3"
107107
},
108108
"publishConfig": {
109109
"access": "public"

packages/ui/src/react/data-table.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,18 @@ export function DataTableToolbar<TData>({
411411
className,
412412
table,
413413
}: {
414-
startToolbar?: React.ReactNode;
415-
endToolbar?: React.ReactNode;
414+
startToolbar?:
415+
| React.ReactNode
416+
| ((table: TableType<TData>) => React.ReactNode);
417+
endToolbar?: React.ReactNode | ((table: TableType<TData>) => React.ReactNode);
416418
className?: string;
417419
table: TableType<TData>;
418420
}): React.JSX.Element {
421+
const renderStartToolbar =
422+
typeof startToolbar === 'function' ? startToolbar(table) : startToolbar;
423+
const renderEndToolbar =
424+
typeof endToolbar === 'function' ? endToolbar(table) : endToolbar;
425+
419426
return (
420427
<div
421428
className={twMerge(
@@ -426,11 +433,11 @@ export function DataTableToolbar<TData>({
426433
>
427434
<div className="flex grow items-center gap-2">
428435
<DataTableSearch table={table} />
429-
{startToolbar}
436+
{renderStartToolbar}
430437
</div>
431438
<div className="flex flex-wrap items-center gap-2">
432439
<DataTableViewOptions table={table} />
433-
{endToolbar}
440+
{renderEndToolbar}
434441
</div>
435442
</div>
436443
);
@@ -779,8 +786,10 @@ export function DataTable<TData>({
779786
}: Omit<TableOptions<TData>, 'getCoreRowModel'> & {
780787
classNames?: TableClassNames;
781788
showFooter?: boolean;
782-
startToolbar?: React.ReactNode;
783-
endToolbar?: React.ReactNode;
789+
startToolbar?:
790+
| React.ReactNode
791+
| ((table: TableType<TData>) => React.ReactNode);
792+
endToolbar?: React.ReactNode | ((table: TableType<TData>) => React.ReactNode);
784793
}): React.JSX.Element {
785794
const table = useReactTable({
786795
columns,

0 commit comments

Comments
 (0)